In this project 2 libraries were created in order to speed up and make easier the generation and reading of excel files through the library apache-poi. The 2 libraries are:
- generator-excel
- read-excel
The main classes to start developing the generator-excel library are:
- ReportExcel is the entity from which the excel file will be generated.
- BaseSheet is the class that represents the Excel sheet, it is extended from:
- SheetData
- SheetSummary
- MergeSheet
- RowSheet is the entity that reprents the row of the sheet
- In the package "bld.generator.report.excel.annotation" there are the annotations to configure the sheet layout, the most important annotations are:
- ExcelHeaderLayout
- ExcelSheetLayout
- ExcelColumn
- ExcelCellLayout
It generates sheets with the following functionalities:
- Functions(sum by column and row).
- Charts.
- It merges cells between rows when they are equals if the option "notMerge" is disabled in the annotation "ExcelSheetLayout".
- To get rows list through a query by the annotation "ExcelQuery" and the "QuerySheetData" entity type.
For the complete documnetation of the generator-excel library, click on the following link:
The main classes to start developing the read-excel library are:
- ExcelRead is the object that represents the excel file.
- SheetRead is the object that represents the excel sheet.
- RowSheetRead is impletened for creating an object that represents the rows of the sheet.
- In the package "bld.read.report.excel.annotation" there are the annotations to map the entities with the sheets an columns of the excel file.
For the complete documnetation of the read-excel library, click on the following link:
Below is a summary table with the features of the functions for generating excel files within class GeneateExcel.
HSSF | XSSF | SXSSF | |
---|---|---|---|
Function | createFileXls | createFileXlsx | createBigDataFileXlsx |
CPU and memory efficiency | Varies | varies | Good |
Read Files | Yes | Yes | No |
Write Files | Yes | Yes | Yes |
Create sheets/rows/cells | Yes | Yes | Yes |
Delete sheets/rows/cells | Yes | Yes | No |
Styling cells | Yes | Yes | Yes |
Shift rows | Yes | Yes | No |
Cloning sheets | Yes | Yes | No |
Formula evaluation | Yes | Yes | No |
Cell comments | Yes | Yes | No |
Picture | Yes | Yes | No |