Class XSSFUtil

java.lang.Object
org.imixs.workflow.poi.XSSFUtil

public class XSSFUtil extends Object
The POIXSSFUtil is a helper class to insert columns and rows into a XSSFWorkbook
Version:
1.0
Author:
rsoika
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    evalXSSFSheet(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 XSWorkbook
    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 postion
    static String
    getCellReference(int col, int row)
    Resolves column and row number into a excel reference.
    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).
    static void
    insertDataRows(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 invoice
    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.
    static void
    poiUpdate(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 invoice
    static void
    replaceXSSFSheetItemValue(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 value
    static void
    updateXSSFWorkbook(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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 inserted
      endColumn - - last column in the sheet
    • getCellReference

      public static String getCellReference(int col, int row)
      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 postion

      Examples 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