Example PIN File Definition

Following the constructors and parameter definitions set out above, a Category Report could be added and defined in the PIN file as follows:




rw.addReport(new CategoryReport("detail/areaTreatedLmu/period", 
                                    "Area by LMU and Species code for period 10",
                                    "hectares", 
                                    control.getBlockTable(),
                                    "product.Area.managed",
                                    "LMU",
                                    lmu,
                                    new int[] {10},
                                    "Spatial Planning Systems",
                                    false));

This PIN file definition of a Category Report was used to create the above output examples. The filename "detail/areaTreatedLmu/period" creates three files "period.html, period.csv, and period.png" and places them in a subfolder of "detail/areaTreatedLmu". This type of filename definition allows the Report Writer to create the well organized directory tree of folders, subfolders and individual reports.

The title of the report will be "Area by LMU and Species code for period 10" and will be followed by the name of the entire scenario folder. This title will also be used in the PNG sub-report along the top of the bar chart. This stacked bar chart will have "hectares" as the units along the Y-axis.

The columnPrefix used to search for unique attribute categories was specified as "product.Area.", therefore any attribute in the Block Table (control.getBlockTable()) that began with this prefix was used to create the report. This prefix was removed when the column headings were created (managed.DF, managed.LA, ...).

"LMU" is the categoryColumn being used to classify the attribute values found with the Prefix into categories. Row categories are defined as an 'array' of values. There are several ways to define an array. If you know the actual values from the categoryColumn you wish to use at the row headings you can define an array as follows (prior to defining the report):

Object [] values = new Object [] {"A","B","C"};
	

The variable name 'values' can then be used as the categories parametre. If you do not know the exact values from the category column you wish to use an advanced method allows you to search the entire column for all unique values and use each unique value as a row heading. Each unique value in the column creates a row heading, in this case all the different "LMUs" make a single row (A,B,C,CH...). A predefined array which creates the actual row headings from the column values would be defined in the PIN file as follows:

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

More information regarding these advanced methods is available in the ReportWriter section of the Patchworks Application Programming Interface (API) Reference or Contact Spatial Planning Systems for more information.

This particular report is only gather information from one period, period 10. More information could have been included in this report by adding more periods to the array list ({10,11,12,13}).

The company name "Spatial Planning Systems" was added in the additionalHTML parameter and will appear underneath the embedded PNG bar chart. Finally, the values in the report are not percentages of the row totals, they are absolute values specified by setting the computePercentparameter to "false".