Package org.imixs.workflow.poi
Class XSSFUtil
java.lang.Object
org.imixs.workflow.poi.XSSFUtil
The POIXSSFUtil is a helper class to insert columns and rows into a
XSSFWorkbook
- Version:
- 1.0
- Author:
- rsoika
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidevalXSSFSheet(org.apache.poi.xssf.usermodel.XSSFWorkbook doc, org.apache.poi.xssf.usermodel.XSSFSheet sheet, String cell) Evaluates a given list of cells in a given XSWorkbookstatic org.apache.poi.xssf.usermodel.XSSFCellgetCellByRef(org.apache.poi.xssf.usermodel.XSSFWorkbook doc, org.apache.poi.xssf.usermodel.XSSFSheet sheet, String cellReference) Returns a Cell by name or an optional absolute cell postionstatic StringgetCellReference(int col, int row) Resolves column and row number into a excel reference.static voidinsertColumn(org.apache.poi.xssf.usermodel.XSSFSheet sheet, int startColumn, int endColumn) Inserts one column in a XSSFSheet before a given start column (beginning by 0).static voidinsertDataRows(List<org.imixs.workflow.ItemCollection> dataset, String referenceCell, List<org.imixs.workflow.ItemCollection> viewItemDefinitions, org.imixs.workflow.FileData fileData) This helper method inserts a row for each invoicestatic voidinsertRows(org.apache.poi.xssf.usermodel.XSSFSheet sheet, String cellReference, int numberOfRows) Insert n rows in a XSSFSheet from a given cell reference.static voidpoiUpdate(org.imixs.workflow.ItemCollection dataDefinition, org.imixs.workflow.FileData fileData, org.imixs.workflow.ItemCollection poiConfig, org.imixs.workflow.engine.WorkflowService workflowService) This helper method applies the POI update defintiions a row for each invoicestatic voidreplaceXSSFSheetItemValue(org.apache.poi.xssf.usermodel.XSSFWorkbook doc, org.apache.poi.xssf.usermodel.XSSFSheet sheet, String find, Object itemValue) Helper method replaces a given cell of a XSSFSheet with a typed item valuestatic voidupdateXSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, org.imixs.workflow.ItemCollection workitem, List<String> replaceDevList, org.imixs.workflow.engine.WorkflowService workflowService) This method updates the XSSFWorkbook document.
-
Field Details
-
ERROR_CONFIG
- See Also:
-
-
Constructor Details
-
XSSFUtil
public XSSFUtil()
-
-
Method Details
-
insertRows
public static void insertRows(org.apache.poi.xssf.usermodel.XSSFSheet sheet, String cellReference, int numberOfRows) Insert n rows in a XSSFSheet from a given cell reference.- Parameters:
sheet-cellReference-numberOfRows-
-
insertColumn
public static void insertColumn(org.apache.poi.xssf.usermodel.XSSFSheet sheet, int startColumn, int endColumn) Inserts one column in a XSSFSheet before a given start column (beginning by 0). The end column defines the last column in the sheet to be shifted (which is the last column in the sheet).- Parameters:
sheet-startColumn- - column before the new column should be insertedendColumn- - last column in the sheet
-
getCellReference
Resolves column and row number into a excel reference.- Parameters:
col-row-- Returns:
-
getCellByRef
public static org.apache.poi.xssf.usermodel.XSSFCell getCellByRef(org.apache.poi.xssf.usermodel.XSSFWorkbook doc, org.apache.poi.xssf.usermodel.XSSFSheet sheet, String cellReference) Returns a Cell by name or an optional absolute cell postionExamples for refs are 'A1', 'AB3', 'MyCell' where 'MyCell' is a named cell.
-
updateXSSFWorkbook
public static void updateXSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, org.imixs.workflow.ItemCollection workitem, List<String> replaceDevList, org.imixs.workflow.engine.WorkflowService workflowService) throws org.imixs.workflow.exceptions.PluginException This method updates the XSSFWorkbook document. The method can be overwritten by subclasses to add additional logic- Parameters:
workbook-workitem-replaceDevList-- Throws:
org.imixs.workflow.exceptions.PluginException
-
replaceXSSFSheetItemValue
public static void replaceXSSFSheetItemValue(org.apache.poi.xssf.usermodel.XSSFWorkbook doc, org.apache.poi.xssf.usermodel.XSSFSheet sheet, String find, Object itemValue) throws org.imixs.workflow.exceptions.PluginException Helper method replaces a given cell of a XSSFSheet with a typed item value- Throws:
org.imixs.workflow.exceptions.PluginException
-
evalXSSFSheet
public static void evalXSSFSheet(org.apache.poi.xssf.usermodel.XSSFWorkbook doc, org.apache.poi.xssf.usermodel.XSSFSheet sheet, String cell) throws org.imixs.workflow.exceptions.PluginException Evaluates a given list of cells in a given XSWorkbook- Parameters:
doc-sheet-cell-- Throws:
org.imixs.workflow.exceptions.PluginException
-
poiUpdate
public static void poiUpdate(org.imixs.workflow.ItemCollection dataDefinition, org.imixs.workflow.FileData fileData, org.imixs.workflow.ItemCollection poiConfig, org.imixs.workflow.engine.WorkflowService workflowService) throws org.imixs.workflow.exceptions.PluginException This helper method applies the POI update defintiions a row for each invoice- Throws:
org.imixs.workflow.exceptions.PluginException
-
insertDataRows
public static void insertDataRows(List<org.imixs.workflow.ItemCollection> dataset, String referenceCell, List<org.imixs.workflow.ItemCollection> viewItemDefinitions, org.imixs.workflow.FileData fileData) throws org.imixs.workflow.exceptions.PluginException This helper method inserts a row for each invoice- Throws:
org.imixs.workflow.exceptions.PluginException
-