Class DatasetExcelAdapter
java.lang.Object
com.inductiveautomation.ignition.common.util.excel.adapters.DatasetExcelAdapter
- All Implemented Interfaces:
ExcelAdapter<Dataset,
org.apache.poi.xssf.streaming.SXSSFWorkbook>
public class DatasetExcelAdapter
extends Object
implements ExcelAdapter<Dataset,org.apache.poi.xssf.streaming.SXSSFWorkbook>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.common.util.excel.adapters.ExcelAdapter
ExcelAdapter.KnownTypes
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
drawSheet
(org.apache.poi.xssf.streaming.SXSSFWorkbook workbook, String sheetName, Dataset dataset, boolean headerRow, boolean nullsEmpty) Draws aSheet
for the specificExcelAdapter
org.apache.poi.xssf.streaming.SXSSFWorkbook
drawWorkbook
(boolean headerRow, boolean nullsEmpty, Dataset[] datasets, String[] sheetNames) Draws the supplied object(s)ExcelAdapter
and returnsExcelAdapter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.common.util.excel.adapters.ExcelAdapter
drawWorkbook
-
Field Details
-
MAX_ROWS_IN_MEMORY
public static final int MAX_ROWS_IN_MEMORY- See Also:
-
-
Constructor Details
-
DatasetExcelAdapter
public DatasetExcelAdapter()
-
-
Method Details
-
drawWorkbook
public org.apache.poi.xssf.streaming.SXSSFWorkbook drawWorkbook(boolean headerRow, boolean nullsEmpty, Dataset[] datasets, String[] sheetNames) Description copied from interface:ExcelAdapter
Draws the supplied object(s)ExcelAdapter
and returnsExcelAdapter
- Specified by:
drawWorkbook
in interfaceExcelAdapter<Dataset,
org.apache.poi.xssf.streaming.SXSSFWorkbook> - Parameters:
headerRow
- iftrue
, header rows are expected to be written, otherwise false. It is up to the implementation whether this is respected or not.nullsEmpty
- iftrue
, null values will not be written to cells in the excel document. It is up to the implementation whether this is respected or not.datasets
- The object(s) that the Adapter is compatible with for writing.sheetNames
- The names of the sheets to create. If null, will use a generic default.- Returns:
- A
Workbook
of typeU
that can be closed or further manipulated.
-
drawSheet
public boolean drawSheet(org.apache.poi.xssf.streaming.SXSSFWorkbook workbook, String sheetName, Dataset dataset, boolean headerRow, boolean nullsEmpty) Description copied from interface:ExcelAdapter
Draws aSheet
for the specificExcelAdapter
- Specified by:
drawSheet
in interfaceExcelAdapter<Dataset,
org.apache.poi.xssf.streaming.SXSSFWorkbook> - Parameters:
workbook
- the Workbook to add the new sheet tosheetName
- the name of the sheet. This name should be checked viaWorkbookUtil.createSafeSheetName(String)
dataset
- the object to write to the sheetheaderRow
- iftrue
, header rows are expected to be written, otherwise false. It is up to the implementation whether this is respected or not.nullsEmpty
- iftrue
, null values will not be written to cells in the excel document. It is up to the implementation whether this is respected or not.- Returns:
true
if the object was successfully written to the workbook as a new sheet,false
if the object was not written successfully.
-