Report Generator
| src | 8 months ago | ||
| .gitignore | 1 year ago | ||
| Jenkinsfile | 2 years ago | ||
| README.md | 8 months ago | ||
| lombok.config | 5 years ago | ||
| pom.xml | 1 year ago | ||
Annotate member variables or methods that will appear on the report
@Reportable(headerName = "Name", column = "A")
@ReportableMap Map<String, Object> map
The map's key will be the headerName
Annotate reportable member variables or methods with formatters (optional)
@DateFormatter(format = "yyyy-MM-dd") @DecimalFormatter(format = "#.00") @StringFormatFormatter(text = "Add %s text") @StringFormatter(format = Format.UPPERCASE) @CurrencyFormatter(format = Currency.USD) @BooleanFormatter(falseText = "Not Valid", trueText = "Valid") @NullFormatter(replacementText = "No Data") @CommaFormatter @TrimFormatter
Instantiate and generate
new CSVGenerator(List<?> data, char delimiter).generate(); // returns CSV String new ExcelGenerator(List<?> data).generate(); // returns POI Workbook
@AutoSize @Reportable(headerName = "Name", column = "A")
AutoSize coupled with Reportable will set the Excel columns to auto-adjust with column width to fit content
@DateFormatter(format = "yyyy-MM-dd")
Data types supported
Format used by java.text.SimpleDateFormat
@DecimalFormatter(format = "#.00")
Data types supported
Format used by java.text.DecimalFormat
@StringFormatter(text = "Add %s text")
Data types supported
@StringFormatter(format = Format.UPPERCASE)
Data types supported
Options
@CurrencyFormatter(format = Currency.USD)
Data types supported
Options
@BooleanFormatter(falseText = "Not Valid", trueText = "Valid")
Arguments
@NullFormatter(replacementText = "No Data")
Data ytpes supported
Arguments
@CommaFormatter
Data types supported
@TrimFormatter
Data types supported
@Hyperlink
Creates a hyperlink out of the cell data
Note: Only applies to ExcelGenerator