Class WorkbookApp

java.lang.Object
de.muehlencord.shared.poi.WorkbookApp

public class WorkbookApp extends Object
Author:
Joern Muehlencord (joern@muehlencord.de)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.poi.ss.usermodel.Workbook
    the workbook to work on
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    autoResizeColumns(org.apache.poi.ss.usermodel.Sheet sheet)
     
    protected void
    autoResizeColumns(org.apache.poi.ss.usermodel.Sheet sheet, int referenceRow)
     
    protected void
    copyCell(org.apache.poi.ss.usermodel.Cell oldCell, org.apache.poi.ss.usermodel.Cell newCell, Map<Integer,org.apache.poi.ss.usermodel.CellStyle> styleMap)
     
    protected void
    copyColumn(org.apache.poi.ss.usermodel.Sheet oldSheet, int oldColumn, org.apache.poi.ss.usermodel.Sheet newSheet, int newColumn)
     
    protected org.apache.poi.ss.util.CellRangeAddress
    getMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet, int rowNum, int cellNum)
     
    protected Integer
    getMergedRegionIndex(org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.util.CellRangeAddress mergedRegion)
     
    org.apache.poi.ss.usermodel.Workbook
    loadWorkbook(String filename)
    opens the given workbook
    void
    stores the (changed) workbook under the given filename
    void
    storeWorkbook(String fileName, String tempName)
    stores the (changed) workbook under the given filename

    Methods inherited from class java.lang.Object

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

    • wb

      protected org.apache.poi.ss.usermodel.Workbook wb
      the workbook to work on
  • Constructor Details

    • WorkbookApp

      public WorkbookApp()
  • Method Details

    • loadWorkbook

      public org.apache.poi.ss.usermodel.Workbook loadWorkbook(String filename) throws IOException
      opens the given workbook
      Parameters:
      filename - path and filename of the workbook to open.
      Returns:
      the workbook loaded
      Throws:
      FileNotFoundException - if the workbook cannot be found
      IOException - if the workbook cannot be loaded
    • storeWorkbook

      public void storeWorkbook(String filename) throws IOException
      stores the (changed) workbook under the given filename
      Parameters:
      filename - the path and name of the file to store the workbook under.
      Throws:
      FileNotFoundException - if the path is not found
      IOException - if the file cannot be genrated.
    • storeWorkbook

      public void storeWorkbook(String fileName, String tempName) throws IOException
      stores the (changed) workbook under the given filename
      Parameters:
      fileName - the path and name of the file to store the workbook under.
      tempName - a temporary name the file is stored under before it is renamed to fileName. This is required as POI cannot open and store a Workbook under the same name.
      Throws:
      FileNotFoundException - if the path is not found
      IOException - if the file cannot be generated.
    • copyColumn

      protected void copyColumn(org.apache.poi.ss.usermodel.Sheet oldSheet, int oldColumn, org.apache.poi.ss.usermodel.Sheet newSheet, int newColumn)
    • copyCell

      protected void copyCell(org.apache.poi.ss.usermodel.Cell oldCell, org.apache.poi.ss.usermodel.Cell newCell, Map<Integer,org.apache.poi.ss.usermodel.CellStyle> styleMap)
    • getMergedRegion

      protected org.apache.poi.ss.util.CellRangeAddress getMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet, int rowNum, int cellNum)
    • getMergedRegionIndex

      protected Integer getMergedRegionIndex(org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.util.CellRangeAddress mergedRegion)
    • autoResizeColumns

      protected void autoResizeColumns(org.apache.poi.ss.usermodel.Sheet sheet)
    • autoResizeColumns

      protected void autoResizeColumns(org.apache.poi.ss.usermodel.Sheet sheet, int referenceRow)