Java Reference
In-Depth Information
catch (FileNotFoundException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
public boolean next() throws JRException
{
boolean retVal = true;
currentRowIndex++;
currentColIndex = 0;
if (currentRowIndex >= totalRows)
{
retVal = false;
}
return retVal;
}
public Object getFieldValue(JRField arg0) throws JRException
{
String value = null;
String[] currentRow = (String[]) rows.get(currentRowIndex);
value = currentRow[currentColIndex];
currentColIndex++;
return value;
}
public void moveFirst() throws JRException
{
currentRowIndex = 0;
currentColIndex = 0;
}
}
In this example, the constructor initializes an instance of au.com.bytecode.
opencsv.CSVReader , a class provided by OpenCsv. The constructor passes an
instance of java.io.Reader as a parameter.
 
Search WWH ::




Custom Search