public class ExcelDataSource extends AbstractPoiXlsDataSource
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 XLSX or XLS file.
columnNames, dateFormat, numberFormat, sheetSelection, useFirstRowAsHeader| Constructor and Description |
|---|
ExcelDataSource(java.io.File file)
Creates a data source instance from an XLSX or XLS file with the default autodetect Excel format.
|
ExcelDataSource(java.io.File file,
ExcelFormatEnum format)
Creates a data source instance from an XLSX or XLS file.
|
ExcelDataSource(java.io.InputStream is)
Creates a data source instance from an XLSX or XLS data input stream with the default autodetect Excel format.
|
ExcelDataSource(java.io.InputStream is,
ExcelFormatEnum format)
Creates a data source instance from an XLSX or XLS data input stream.
|
ExcelDataSource(JasperReportsContext jasperReportsContext,
java.lang.String location)
Creates a datasource instance that reads XLSX or XLS data from a given location.
|
ExcelDataSource(JasperReportsContext jasperReportsContext,
java.lang.String location,
ExcelFormatEnum format)
Creates a datasource instance that reads XLSX or XLS data from a given location.
|
ExcelDataSource(java.lang.String location) |
ExcelDataSource(java.lang.String location,
ExcelFormatEnum format) |
ExcelDataSource(org.apache.poi.ss.usermodel.Workbook workbook)
Creates a data source instance from a workbook with the default autodetect Excel format.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.poi.ss.usermodel.Workbook |
loadWorkbook(java.io.InputStream inputStream) |
checkReadStarted, close, getFieldValue, moveFirst, nextgetColumnNames, getDateFormat, getNumberFormat, getSheetSelection, setColumnIndexes, setColumnNames, setColumnNames, setDateFormat, setNumberFormat, setSheetSelection, setUseFirstRowAsHeaderconvertNumber, convertStringValue, getConvertBean, getDatePattern, getFormattedDate, getFormattedNumber, getLocale, getNumberPattern, getTimeZone, setDatePattern, setLocale, setLocale, setNumberPattern, setTextAttributes, setTimeZone, setTimeZonepublic ExcelDataSource(org.apache.poi.ss.usermodel.Workbook workbook)
workbook - the workbookpublic ExcelDataSource(java.io.InputStream is)
throws JRException,
java.io.IOException
is - an input stream containing XLSX or XLS dataJRExceptionjava.io.IOExceptionpublic ExcelDataSource(java.io.InputStream is,
ExcelFormatEnum format)
throws JRException,
java.io.IOException
is - an input stream containing XLSX or XLS dataformat - the Excel formatJRExceptionjava.io.IOExceptionpublic ExcelDataSource(java.io.File file)
throws JRException,
java.io.IOException
file - a file containing XLSX or XLS datajava.io.FileNotFoundExceptionJRExceptionjava.io.IOExceptionpublic ExcelDataSource(java.io.File file,
ExcelFormatEnum format)
throws JRException,
java.io.IOException
file - a file containing XLSX or XLS dataformat - the Excel formatjava.io.FileNotFoundExceptionJRExceptionjava.io.IOExceptionpublic ExcelDataSource(JasperReportsContext jasperReportsContext, java.lang.String location) throws JRException, java.io.IOException
jasperReportsContext - the JasperReportsContextlocation - a String representing XLSX or XLS data sourcejava.io.IOExceptionJRExceptionpublic ExcelDataSource(JasperReportsContext jasperReportsContext, java.lang.String location, ExcelFormatEnum format) throws JRException, java.io.IOException
jasperReportsContext - the JasperReportsContextlocation - a String representing XLSX or XLS data sourceformat - the Excel formatjava.io.IOExceptionJRExceptionpublic ExcelDataSource(java.lang.String location)
throws JRException,
java.io.IOException
JRExceptionjava.io.IOExceptionExcelDataSource(JasperReportsContext, String)public ExcelDataSource(java.lang.String location,
ExcelFormatEnum format)
throws JRException,
java.io.IOException
JRExceptionjava.io.IOExceptionExcelDataSource(JasperReportsContext, String)protected org.apache.poi.ss.usermodel.Workbook loadWorkbook(java.io.InputStream inputStream)
throws java.io.IOException
loadWorkbook in class AbstractPoiXlsDataSourcejava.io.IOException© 2001-2010 Jaspersoft Corporation www.jaspersoft.com