InetSoft Documentation: Reporting API Conventions
InetSoft reporting uses two report layout models, namely tabular layout and flow layout. Tabular layout divides the report layout area into cells on a grid. Report elements are added one by one to specific cells on the grid. With Flow layout, the report elements are added as a continuous flow, one after another, similar to a regular word processor.
The ReportSheet class is the main API used by programs to create a report. It is used to create a report object containing both report contents and report layout attributes.
The ReportSheet class is extended to support the two report layout models in the TabularSheet and the StyleSheet classes. The TabularSheet is the API for the tabular layout model and the StyleSheet (not to be confused with Cascading Style Sheets) is the API for the flow layout model. The API common to both layout models is captured in the ReportSheet class.
A ReportSheet object can be created programmatically, or loaded from a report template create in Report Designer. Template based reporting is described in the Report Designer. The ReportSheet class has three major types of methods.
• The first type of method modifies or retrieves global attributes shared by the entire document. These include the page margins, starting page number, etc. These methods are named as 'get' and 'set' methods with the names of the attribute appended.
• The second class of method modifies the current attribute set of the document. The ReportSheet always maintains a set of current attributes. These attributes are not shared by the entire document, but are picked up by report elements when they are added. Changing the attributes in the current set does not change the attributes of the elements that already exist in the report. They apply to the elements added after the attribute change and before the next change. This type of method is named 'getCurrent' and 'setCurrent,' with the name of the attribute appended.
• The third type of method is used to populate the document with elements. In the case of the ReportSheet, the 'addHeader' method appended with the 'element name' adds the element to the 'report header'. The 'addFooter' method appended with the 'element name' adds the element to the 'report footer'.
To add elements to the 'report body' we must choose one of the two layout models. In the case of TabularSheet, the 'add' method appended with the 'element name' adds the element to the 'report body' in a specified cell on the grid. The cell is specified with a row and column number. In the case of StyleSheet the 'add' method appended with the 'element name' adds the element to the 'report body'.
The existence of states in the function call is different from normal property “setter” and “getter” functions. It is similar to the method used to create a document with a word processor.