I. Overview
The FineReport designer and its platform should satisfy most of the demands, but still, it's impossible to meet all the individual needs. In this connection, FineReport has provided an abundant supply of APIs for developers to carry out in-depth development and control. To understand the core structure and API usage, developers should be equipped with elementary concepts which are shown in the diagram below:
TemplateWorkBook: the unexecuted WorkBook
ResultWorkBook: the result of the report object calculated by the Report Compute Engine (Executor). Items set up in the template, such as filters, conditions and styles, are all saved as calculated values into the result report.
WorkBook: the report template object, or the Java object corresponding to the cpt file. It is a container of WorkSheets, equivalent to creating multiple sheets in a single report.
WorkSheet: consists of any number of CellElements.
For example, you can set up the cell background, border, font, font size, etc., add or delete cells in each WorkSheet, set page properties and add floating elements to each sheet, execute WorkBook to obtain the results and export to various formats, print, add toolbars, etc. It is for this reason that FineReport provides an extensive set of APIs for developers, assisting in the in-depth control of reports to fulfill their personalized requirements.
II. Public API
From the diagram above, we can see that FineReport mainly offers four function points for tailored development.
1. Report Data Source
While FineReport designer has diversified built-in data source interfaces, such as database, file and XML data source, developers can also generate their own data sources through Java programs by implementing the interface TableData.
2. Set Cell Attributes and Report Attributes
You can set up the cell properties, Web properties, parameters, page settings and attributes of other report objects, or freely control the display style of cells, buttons on the toolbar, the parameter panel, the assignment of parameter values, etc. All your individual needs will be taken care of.
3. Custom Functions
Despite a large number of basic functions FineReport has provided, you can customize your functions for specific business needs as well.
4. Import/Export Reports
You can create a new report object or load a cpt file to generate it. The processed report saved as a class web report can be accessed on the Web, and supports for exporting as files with various formats, such as Excel, PDF, Word and cpt files.