Package bld.generator.report.excel.impl
Class SuperGenerateExcelImpl
java.lang.Object
bld.generator.report.excel.impl.SuperGenerateExcelImpl
- Direct Known Subclasses:
ScopeGenerateExcelImpl
The Class SuperGenerateExcelImpl.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<DropDownCell> The list drop down.protected List<FunctionCell> The list function cell.protected Map<LayoutCell, org.apache.poi.ss.usermodel.CellStyle> The map cell header style.protected Map<LayoutCell, org.apache.poi.ss.usermodel.CellStyle> The map cell style.protected Map<String, InfoColumn> The map field column.The map sheet.The map width column.protected org.apache.poi.ss.usermodel.CellStyleThe merge calcolo cells.protected static final SimpleDateFormatThe Constant SDF.protected SheetMappingSheetprotected ValuePropsThe value props. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComment(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Row row, org.apache.poi.ss.usermodel.Cell cellHeader, String commento) Adds the comment.protected voidaddDropDown(DropDownCell dropDownCell) Adds the drop down.protected StringbuildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType) Builds the function.protected StringbuildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType, boolean blockColumn, boolean blockRow) Builds the function.protected StringbuildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType, ExcelFormulaAlias[] alias) Builds the function.protected org.apache.poi.ss.usermodel.CellStylecreateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelCellLayout layout, SheetHeader sheetHeader, Integer indexRow) Creates the cell style.protected org.apache.poi.ss.usermodel.CellStylecreateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelCellLayout layout, Integer indexRow) Creates the cell style.protected org.apache.poi.ss.usermodel.CellStylecreateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelHeaderCellLayout layout) Creates the cell style.protected IntegercreatePivot(org.apache.poi.xssf.usermodel.XSSFSheet sheet, SheetData<?> sheetData, int firstRow, int firstColumn, int lastRow, int lastColumn, Integer indexRow) Creates the pivot.protected org.apache.poi.ss.usermodel.CellStyledateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.CellStyle cellStyle, String format) Date cell style.protected <T extends RowSheet>
List<SheetHeader> generateHeaderSheetData(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetData<T> sheetData, Integer indexRow) Generate header sheet data.protected org.apache.poi.ss.usermodel.CellStylegetBorder(org.apache.poi.ss.usermodel.CellStyle cellStyle, ExcelBorder excelBorder) Gets the border.org.apache.poi.ss.usermodel.CellStylegetCellStyleHeader(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetComponent sheetComponent, org.apache.poi.ss.usermodel.Row rowHeader) Gets the cell style header.protected org.apache.poi.xssf.usermodel.XSSFColorgetColor(byte... rgbColor) Gets the color.protected org.apache.poi.ss.usermodel.FontGets the font.protected List<SheetHeader> getListSheetHeader(Class<?> classRow, Object entity, org.apache.poi.ss.usermodel.Sheet sheet) Gets the list sheet header.protected <T extends RowSheet>
intgetSizeSuperHeader(SheetData<T> sheetData) Gets the size super header.protected voidmanageDropDown(org.apache.poi.ss.usermodel.Sheet sheet, SheetHeader sheetHeader, int firstRow, int lastRow, int firstCol, int lastCol, Integer indexRow) Manage drop down.protected ObjectmanageExcelImage(SheetHeader sheetHeader, Object value) Manage excel image.protected voidmergeRow(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, Map<Integer, MergeCell> mapMergeRow, int numColumn, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) Merge row.protected voidmergeRowAndRemoveMap(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, Map<Integer, MergeCell> mapMergeRow, int numColumn, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) Merge row and remove map.protected voidrunMergeCell(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeCell, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) Run merge cell.protected voidsetCellFormula(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) Sets the cell formula.protected org.apache.poi.ss.usermodel.CellsetCellFormula(org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeRow, Integer indexRow) Sets the cell formula.protected voidsetCellFormulaAndEvaluate(org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeRow, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) Sets the cell formula excel.protected voidsetCellFormulaAndEvaluateCell(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) Sets the cell formula excel.protected voidsetCellStyleExcel(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.Cell cell, LayoutCell layoutCell) Sets the cell style excel.protected voidsetCellSummary(ExcelSheetLayout excelSheetLayout, org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetSummary sheetSummary, SheetHeader sheetHeader, org.apache.poi.ss.usermodel.Row row, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) Sets the cell summary.protected voidsetCellValueExcel(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) Sets the cell value excel.protected voidsetCellValueExcel(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) Sets the cell value excel.protected booleansetCellValueWillMerged(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.Cell cell, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) Sets the cell value will merged.protected voidsetColumnWidth(org.apache.poi.ss.usermodel.Sheet sheet, Integer index, Integer width) Sets the column width.
-
Field Details
-
SDF
The Constant SDF. -
mergeCalcoloCells
protected org.apache.poi.ss.usermodel.CellStyle mergeCalcoloCellsThe merge calcolo cells. -
mapCellStyle
The map cell style. -
mapCellHeaderStyle
The map cell header style. -
mapFieldColumn
The map field column. -
mapWidthColumn
The map width column. -
listFunctionCell
The list function cell. -
listDropDown
The list drop down. -
mapSheet
The map sheet. -
sheetMapping
-
valueProps
The value props.
-
-
Constructor Details
-
SuperGenerateExcelImpl
public SuperGenerateExcelImpl()Instantiates a new super generate excel impl.
-
-
Method Details
-
createCellStyle
protected org.apache.poi.ss.usermodel.CellStyle createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelHeaderCellLayout layout) Creates the cell style.- Parameters:
workbook- the workbooklayout- the layout- Returns:
- the cell style
-
createCellStyle
protected org.apache.poi.ss.usermodel.CellStyle createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelCellLayout layout, Integer indexRow) throws Exception Creates the cell style.- Parameters:
workbook- the workbooklayout- the layoutindexRow- the index row- Returns:
- the cell style
- Throws:
Exception- the exception
-
createCellStyle
protected org.apache.poi.ss.usermodel.CellStyle createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelCellLayout layout, SheetHeader sheetHeader, Integer indexRow) throws Exception Creates the cell style.- Parameters:
workbook- the workbooklayout- the layoutsheetHeader- the sheet headerindexRow- the index row- Returns:
- the cell style
- Throws:
Exception- the exception
-
getFont
protected org.apache.poi.ss.usermodel.Font getFont(org.apache.poi.ss.usermodel.Workbook workbook, ExcelFont excelFont) Gets the font.- Parameters:
workbook- the workbookexcelFont- the excel font- Returns:
- the font
-
getColor
protected org.apache.poi.xssf.usermodel.XSSFColor getColor(byte... rgbColor) Gets the color.- Parameters:
rgbColor- the rgb color- Returns:
- the color
-
getBorder
protected org.apache.poi.ss.usermodel.CellStyle getBorder(org.apache.poi.ss.usermodel.CellStyle cellStyle, ExcelBorder excelBorder) Gets the border.- Parameters:
cellStyle- the cell styleexcelBorder- the excel border- Returns:
- the border
-
getListSheetHeader
protected List<SheetHeader> getListSheetHeader(Class<?> classRow, Object entity, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception Gets the list sheet header.- Parameters:
classRow- the class rowentity- the entitysheet- the sheet- Returns:
- the list sheet header
- Throws:
Exception- the exception
-
setCellValueWillMerged
protected boolean setCellValueWillMerged(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.Cell cell, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception Sets the cell value will merged.- Parameters:
workbook- the workbookcellStyle- the cell stylecell- the cellsheetHeader- the sheet headerindexRow- the index rowsheet- the sheet- Returns:
- true, if successful
- Throws:
Exception- the exception
-
mergeRowAndRemoveMap
protected void mergeRowAndRemoveMap(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, Map<Integer, MergeCell> mapMergeRow, int numColumn, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws ExceptionMerge row and remove map.- Parameters:
workbook- the workbooksheet- the sheetindexRow- the index rowmapMergeRow- the map merge rownumColumn- the num columnformulaEvaluator- the formula evaluator- Throws:
Exception- the exception
-
mergeRow
protected void mergeRow(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, Map<Integer, MergeCell> mapMergeRow, int numColumn, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws ExceptionMerge row.- Parameters:
workbook- the workbooksheet- the sheetindexRow- the index rowmapMergeRow- the map merge rownumColumn- the num columnformulaEvaluator- the formula evaluator- Throws:
Exception- the exception
-
runMergeCell
protected void runMergeCell(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeCell, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception Run merge cell.- Parameters:
workbook- the workbooksheet- the sheetmergeCell- the merge cellformulaEvaluator- the formula evaluator- Throws:
Exception- the exception
-
addComment
protected void addComment(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Row row, org.apache.poi.ss.usermodel.Cell cellHeader, String commento) Adds the comment.- Parameters:
workbook- the workbooksheet- the sheetrow- the rowcellHeader- the cell headercommento- the commento
-
setCellSummary
protected void setCellSummary(ExcelSheetLayout excelSheetLayout, org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetSummary sheetSummary, SheetHeader sheetHeader, org.apache.poi.ss.usermodel.Row row, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception Sets the cell summary.- Parameters:
excelSheetLayout- the excel sheet layoutworkbook- the workbooksheet- the sheetsheetSummary- the sheet summarysheetHeader- the sheet headerrow- the rowindexRow- the index rowformulaEvaluator- the formula evaluator- Throws:
Exception- the exception
-
setCellValueExcel
protected void setCellValueExcel(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception Sets the cell value excel.- Parameters:
workbook- the workbooksheet- the sheetcell- the cellcellStyle- the cell stylesheetHeader- the sheet headerindexRow- the index rowformulaEvaluator- the formula evaluator- Throws:
Exception- the exception
-
setCellFormulaAndEvaluateCell
protected void setCellFormulaAndEvaluateCell(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception Sets the cell formula excel.- Parameters:
cell- the cellcellStyle- the cell stylesheetHeader- the sheet headerindexRow- the index rowsheet- the sheetformulaEvaluator- the formula evaluator- Throws:
Exception- the exception
-
setCellFormula
protected void setCellFormula(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception Sets the cell formula.- Parameters:
cell- the cellcellStyle- the cell stylesheetHeader- the sheet headerindexRow- the index rowsheet- the sheet- Throws:
Exception- the exception
-
buildFunction
protected String buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType, ExcelFormulaAlias[] alias) throws Exception Builds the function.- Parameters:
sheet- the sheetindexRow- the index rowfunction- the functionrowStartEndType- the row start end typealias- the alias- Returns:
- the string
- Throws:
Exception- the exception
-
buildFunction
protected String buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType, boolean blockColumn, boolean blockRow) throws Exception Builds the function.- Parameters:
sheet- the sheetindexRow- the index rowfunction- the functionrowStartEndType- the row start end typeblockColumn- the dollarblockRow- the block row- Returns:
- the string
- Throws:
Exception- the exception
-
buildFunction
protected String buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType) throws Exception Builds the function.- Parameters:
sheet- the sheetindexRow- the index rowfunction- the functionrowStartEndType- the row start end type- Returns:
- the string
- Throws:
Exception- the exception
-
setCellFormulaAndEvaluate
protected void setCellFormulaAndEvaluate(org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeRow, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception Sets the cell formula excel.- Parameters:
sheet- the sheetmergeRow- the merge rowindexRow- the index rowformulaEvaluator- the formula evaluator- Throws:
Exception- the exception
-
setCellFormula
protected org.apache.poi.ss.usermodel.Cell setCellFormula(org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeRow, Integer indexRow) throws Exception Sets the cell formula.- Parameters:
sheet- the sheetmergeRow- the merge rowindexRow- the index row- Returns:
- the cell
- Throws:
Exception- the exception
-
setCellValueExcel
protected void setCellValueExcel(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception Sets the cell value excel.- Parameters:
workbook- the workbookcell- the cellcellStyle- the cell stylesheetHeader- the sheet headerindexRow- the index rowsheet- the sheet- Throws:
Exception- the exception
-
dateCellStyle
protected org.apache.poi.ss.usermodel.CellStyle dateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.CellStyle cellStyle, String format) throws Exception Date cell style.- Parameters:
workbook- the workbookcellStyle- the cell styleformat- the format- Returns:
- the cell style
- Throws:
Exception- the exception
-
setCellStyleExcel
protected void setCellStyleExcel(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.Cell cell, LayoutCell layoutCell) Sets the cell style excel.- Parameters:
cellStyle- the cell stylecell- the celllayoutCell- the layout cell
-
getCellStyleHeader
public org.apache.poi.ss.usermodel.CellStyle getCellStyleHeader(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetComponent sheetComponent, org.apache.poi.ss.usermodel.Row rowHeader) throws Exception Gets the cell style header.- Parameters:
workbook- the workbooksheet- the sheetsheetComponent- the sheet componentrowHeader- the row header- Returns:
- the cell style header
- Throws:
Exception- the exception
-
generateHeaderSheetData
protected <T extends RowSheet> List<SheetHeader> generateHeaderSheetData(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetData<T> sheetData, Integer indexRow) throws Exception Generate header sheet data.- Type Parameters:
T- the generic type- Parameters:
workbook- the workbooksheet- the sheetsheetData- the sheet dataindexRow- the index row- Returns:
- the list
- Throws:
Exception- the exception
-
getSizeSuperHeader
Gets the size super header.- Type Parameters:
T- the generic type- Parameters:
sheetData- the sheet data- Returns:
- the size super header
-
setColumnWidth
protected void setColumnWidth(org.apache.poi.ss.usermodel.Sheet sheet, Integer index, Integer width) throws Exception Sets the column width.- Parameters:
sheet- the sheetindex- the index columnwidth- the width- Throws:
Exception- the exception
-
createPivot
protected Integer createPivot(org.apache.poi.xssf.usermodel.XSSFSheet sheet, SheetData<?> sheetData, int firstRow, int firstColumn, int lastRow, int lastColumn, Integer indexRow) Creates the pivot.- Parameters:
sheet- the sheetsheetData- the sheet datafirstRow- the first rowfirstColumn- the first columnlastRow- the last rowlastColumn- the last columnindexRow- the index row- Returns:
- the integer
-
manageDropDown
protected void manageDropDown(org.apache.poi.ss.usermodel.Sheet sheet, SheetHeader sheetHeader, int firstRow, int lastRow, int firstCol, int lastCol, Integer indexRow) Manage drop down.- Parameters:
sheet- the sheetsheetHeader- the sheet headerfirstRow- the first rowlastRow- the last rowfirstCol- the first collastCol- the last col
-
addDropDown
Adds the drop down.- Parameters:
dropDownCell- the drop down cell- Throws:
Exception- the exception
-
manageExcelImage
protected Object manageExcelImage(SheetHeader sheetHeader, Object value) throws Exception, FileNotFoundException, IOException Manage excel image.- Parameters:
sheetHeader- the sheet headervalue- the value- Returns:
- the object
- Throws:
Exception- the exceptionFileNotFoundException- the file not found exceptionIOException- Signals that an I/O exception has occurred.
-