XlsDataSource
.public class JRXlsDataSource extends AbstractXlsDataSource
The default naming convention is to name report fields COLUMN_x and map each column with the field found at index x in each row (these indices start with 0). To avoid this situation, users can either specify a collection of column names or set a flag to read the column names from the first row of the CSV file.
columnIndexMap, columnNames, dateFormat, EXCEPTION_MESSAGE_KEY_XLS_COLUMN_NAMES_MISMATCH_COLUMN_INDEXES, EXCEPTION_MESSAGE_KEY_XLS_FIELD_VALUE_NOT_RETRIEVED, EXCEPTION_MESSAGE_KEY_XLS_SHEET_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_XLS_SHEET_NOT_FOUND, INDEXED_COLUMN_PREFIX, numberFormat, PROPERTY_FIELD_COLUMN_INDEX, PROPERTY_FIELD_COLUMN_NAME, sheetSelection, useFirstRowAsHeader
EXCEPTION_MESSAGE_KEY_CANNOT_CONVERT_FIELD_TYPE, EXCEPTION_MESSAGE_KEY_CANNOT_MODIFY_PROPERTIES_AFTER_START, EXCEPTION_MESSAGE_KEY_NODE_NOT_AVAILABLE, EXCEPTION_MESSAGE_KEY_NULL_DOCUMENT, EXCEPTION_MESSAGE_KEY_NULL_SELECT_EXPRESSION, EXCEPTION_MESSAGE_KEY_UNKNOWN_COLUMN_NAME, EXCEPTION_MESSAGE_KEY_UNKNOWN_NUMBER_TYPE
Constructor and Description |
---|
JRXlsDataSource(java.io.File file)
Deprecated.
Creates a data source instance from an XLS file.
|
JRXlsDataSource(java.io.InputStream is)
Deprecated.
Creates a data source instance from an XLS data input stream.
|
JRXlsDataSource(JasperReportsContext jasperReportsContext,
java.lang.String location)
Deprecated.
Creates a datasource instance that reads XLS data from a given location.
|
JRXlsDataSource(java.lang.String location)
Deprecated.
|
JRXlsDataSource(jxl.Workbook workbook)
Deprecated.
Creates a data source instance from a workbook.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkReadStarted()
Deprecated.
|
void |
close()
Deprecated.
Closes the reader.
|
java.lang.Object |
getFieldValue(JRField jrField)
Deprecated.
Gets the field value for the current position.
|
void |
moveFirst()
Deprecated.
Moves back to the first element in the data source.
|
boolean |
next()
Deprecated.
Tries to position the cursor on the next element in the data source.
|
getColumnIndex, getColumnNames, getDateFormat, getNumberFormat, getSheetSelection, setColumnIndexes, setColumnNames, setColumnNames, setDateFormat, setNumberFormat, setSheetSelection, setUseFirstRowAsHeader
convertNumber, convertStringValue, getConvertBean, getDatePattern, getFormattedDate, getFormattedNumber, getLocale, getNumberPattern, getTextAttributes, getTimeZone, setDatePattern, setLocale, setLocale, setNumberPattern, setTextAttributes, setTextAttributes, setTimeZone, setTimeZone
public JRXlsDataSource(jxl.Workbook workbook)
workbook
- the workbookpublic JRXlsDataSource(java.io.InputStream is) throws JRException, java.io.IOException
is
- an input stream containing XLS dataJRException
java.io.IOException
public JRXlsDataSource(java.io.File file) throws JRException, java.io.FileNotFoundException, java.io.IOException
file
- a file containing XLS dataJRException
java.io.FileNotFoundException
java.io.IOException
public JRXlsDataSource(JasperReportsContext jasperReportsContext, java.lang.String location) throws JRException, java.io.IOException
jasperReportsContext
- the JasperReportsContextlocation
- a String representing XLS data sourcejava.io.IOException
JRException
public JRXlsDataSource(java.lang.String location) throws JRException, java.io.IOException
JRException
java.io.IOException
JRXlsDataSource(JasperReportsContext, String)
public boolean next() throws JRException
JRDataSource
JRException
- if any error occurs while trying to move to the next elementpublic void moveFirst()
JRRewindableDataSource
public java.lang.Object getFieldValue(JRField jrField) throws JRException
JRDataSource
JRException
public void close()
close
in class AbstractXlsDataSource
protected void checkReadStarted()
checkReadStarted
in class AbstractXlsDataSource
© 2001 - 2017 TIBCO Software Inc. www.jaspersoft.com