Parameters and Constructors

Figure 132. Standard Report Constructor

 public StandardReport (String filename,                1
                        String title,                   2
                        String units,                   3
                        AttributeStore sourceDataTable, 4
                        String targetPattern,           5
                        String expression,              6
                        String additionalHTML,          7
                        boolean computePercent)         8
        	


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.

2

title - The title to be displayed in the HTML and PNG sub-reports. The report writer will automatically append the Scenario Name (name given to the scenario folder or will indicate it is from the currently running scenario) 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

targetPattern - A string containing the prefix of the targets of interest. This will allow the report to search for ALL targets beginning with this prefix. This prefix will be eliminated when used in HTML table column headings, therefore include the last "." so it will not show up in headings. ("product.area.")

6

expression - An expression describing the data value to be displayed in the cells of the table. The expression can refer to any column in the sourceDataTable. The actual value contained in the specified column could be written in the cells, or the value could be modified to represent other information. For example "CURRENT/PERIODWIDTH" would create a new value derived from the values contained in the two columns labelled "CURRENT" and "PERIODWIDTH".

7

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 is displayed below the embedded PNG bar chart: General Report Layout.

8

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. If the data is best represented as a percent indicate true or if absolute values are more appropriate indicate false.

[Important]Important

The BlockTable and TargetTable are internal Patchworks tables that keep track of all the necessary 'book keeping' while the model is running. These tables are most often used to create reports and are referenced through the method control.getTargetTable() or control.getBlockTable(). If for some reason you wished to construct a report based on information from attributes of a shapefile or coverage it's not a problem!

To do this the file can be opened and given a variable name to be used when defining any type of report. Use the GeoRelationalStore class with the open method (see the Patchworks Appication Programming Interface (API) Reference for more detailed info).

GeoRelationalStore fragment =
	  GeoRelationalStore.open("../data/fragments.shp");
	  

Now the variable name fragment can be used at the dataSourceTable when defining reports. This method can be used anywhere in the PIN file to open shape files and coverages.