java.lang.Object
jp.ecuacion.util.poi.excel.util.ExcelWriteUtil
Provides excel writing related
apache POI utility methods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.poi.ss.usermodel.WorkbookcreateWorkbookWithSheet(String sheetName) Creates new workbook with adding sheet of namesheetName.getReadyToWriteTableData(ExcelTableWriter<T> writer, org.apache.poi.ss.usermodel.Workbook workbook, String sheetName) Gets ready to write table data.openForOutput(String filePath) Opens the excel file and returnsWorkbookobject.org.apache.poi.ss.usermodel.WorkbookopenForWrite(String filePath) Opens the excel file and returnsWorkbookobject.voidsaveToFile(org.apache.poi.ss.usermodel.Workbook workbook, FileOutputStream out) Opens the excel file and returnsWorkbookobject.<T> voidwriteTableLine(ExcelTableWriter<T> writer, ExcelTable.ContextContainer context, int rowNumber, List<T> columnList) Provides common procedure for write one line of a table.
-
Constructor Details
-
ExcelWriteUtil
public ExcelWriteUtil()
-
-
Method Details
-
createWorkbookWithSheet
Creates new workbook with adding sheet of namesheetName.- Parameters:
sheetName- sheetName- Returns:
- Workbook
-
openForWrite
public org.apache.poi.ss.usermodel.Workbook openForWrite(String filePath) throws org.apache.poi.EncryptedDocumentException, IOException Opens the excel file and returnsWorkbookobject.- Parameters:
filePath- filePath- Returns:
- workbook
- Throws:
org.apache.poi.EncryptedDocumentException- EncryptedDocumentExceptionIOException- IOException
-
openForOutput
public FileOutputStream openForOutput(String filePath) throws org.apache.poi.EncryptedDocumentException, IOException Opens the excel file and returnsWorkbookobject.- Parameters:
filePath- filePath- Returns:
- workbook
- Throws:
org.apache.poi.EncryptedDocumentException- EncryptedDocumentExceptionIOException- IOException
-
saveToFile
public void saveToFile(org.apache.poi.ss.usermodel.Workbook workbook, FileOutputStream out) throws org.apache.poi.EncryptedDocumentException, IOException Opens the excel file and returnsWorkbookobject.- Throws:
org.apache.poi.EncryptedDocumentExceptionIOException
-
getReadyToWriteTableData
public <T> ExcelTable.ContextContainer getReadyToWriteTableData(ExcelTableWriter<T> writer, org.apache.poi.ss.usermodel.Workbook workbook, String sheetName) throws jp.ecuacion.lib.core.exception.checked.BizLogicAppException Gets ready to write table data.- Throws:
jp.ecuacion.lib.core.exception.checked.BizLogicAppException
-
writeTableLine
public <T> void writeTableLine(ExcelTableWriter<T> writer, ExcelTable.ContextContainer context, int rowNumber, List<T> columnList) Provides common procedure for write one line of a table.
-