Parameters and Constructors

A Category Report is defined in the PIN by specifying 10 simple parameters. The following figure shows the construction of a Category Report.

Figure 138. Category Report Constructor


  public CategoryReport (String filename,               1
                        String title,                   2
                        String units,                   3
                        AttributeStore sourceDataTable, 4
                        String columnPrefix,            5
                        String categoryColumn,          6 
                        Object[] categories,            7
                        int[] periods,                  8
                        String additionalHTML,          9
                        boolean computePercent) {       10  
	  


1

filename - The basename to be used for output from this report. This name must be unique with respect to other reports added to the report writer. The name should not contain a filename extension since the report will automatically add ".html", ".png", or ".csv" as appropriate. If this report is to be grouped with other similar reports in a folder, the folder and filename must be specified here (for example: detail_period/area/age_class).

2

title - The title to be displayed in the HTML and PNG sub-reports. The report writer will automatically append the Scenario Name to the to the report title.

3

units - The units of measure to be displayed on the Y-axis of the PNG sub-report.

4

sourceDataTable - The table containing the data to be summarized.

5

columnPrefix - The prefix used to find database columns that will compose the columns of the report, where all matching columns will be used. The columns in the data source table that match the prefix will create the columns of the HTML table however the prefix will be removed (For example: "product.Area.managed" will be searched for and the unique attributes will be used to create the columns). Unique attributes may be product.Area.managed.conif and product.Area.managed.decid), however the columns will appear as "conif" and "decid".

6

categoryColumn - The database column containing values used to classify records into the rows of the table.

7

categories - An array of String labels providing the row names to be used for this table. For example: this array searches the LMU column of the Block Table for unique values. Each unique value will have a seperate row, which will be totalled at the end.


Object[] lmus = control.getBlockTable().uniqueValues("LMU");

8

periods - An array of period numbers that will be used in composing the report. Only values from the specified period list will be used, meaning reports can be customized to represent only certain periods of interest. For example: this array specifies that only Periods 1-5 should be represented in this report.


new int[] {1,2,3,4,5},

9

additionalHTML - Artibrary HTML format text that can be added in to the HTML sub-report. This text can contain explanatory text, display a coporate logo, or provide a hyper-link to a related table. This text will be displayed directly below the PNG stacked bar chart.

10

computePercent - A boolean value that indicates if the cell data should be converted to percent of the row total. Percent format data can assist in showing change in relative composition over time.