Package de.muehlencord.shared.poi
Class WorkbookApp
java.lang.Object
de.muehlencord.shared.poi.WorkbookApp
- Author:
- Joern Muehlencord (joern@muehlencord.de)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.poi.ss.usermodel.Workbookthe workbook to work on -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidautoResizeColumns(org.apache.poi.ss.usermodel.Sheet sheet) protected voidautoResizeColumns(org.apache.poi.ss.usermodel.Sheet sheet, int referenceRow) protected voidcopyCell(org.apache.poi.ss.usermodel.Cell oldCell, org.apache.poi.ss.usermodel.Cell newCell, Map<Integer, org.apache.poi.ss.usermodel.CellStyle> styleMap) protected voidcopyColumn(org.apache.poi.ss.usermodel.Sheet oldSheet, int oldColumn, org.apache.poi.ss.usermodel.Sheet newSheet, int newColumn) protected org.apache.poi.ss.util.CellRangeAddressgetMergedRegion(org.apache.poi.ss.usermodel.Sheet sheet, int rowNum, int cellNum) protected IntegergetMergedRegionIndex(org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.util.CellRangeAddress mergedRegion) org.apache.poi.ss.usermodel.WorkbookloadWorkbook(String filename) opens the given workbookvoidstoreWorkbook(String filename) stores the (changed) workbook under the given filenamevoidstoreWorkbook(String fileName, String tempName) stores the (changed) workbook under the given filename
-
Field Details
-
wb
protected org.apache.poi.ss.usermodel.Workbook wbthe workbook to work on
-
-
Constructor Details
-
WorkbookApp
public WorkbookApp()
-
-
Method Details
-
loadWorkbook
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 foundIOException- if the workbook cannot be loaded
-
storeWorkbook
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 foundIOException- if the file cannot be genrated.
-
storeWorkbook
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 foundIOException- 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
-
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)
-