Class ColumnSummaryReport

All Implemented Interfaces:
Selectable<Report>, Comparable<Report>

public class ColumnSummaryReport extends Report
The ColumnSummaryReport class creates reports that summarize groups of records found in the specified sourceDataTable. Each row in the report represents data summarized from a single planning period. All planning periods are reported.

The report uses CSS styling attributes to format the cells of the report table. The style to be applied is selected by a value from the source table.

 cellFormats = new RangeLabel[] {
    new RangeLabel("background-color:#7fc97f", 0, 50.0001),
    new RangeLabel("background-color:#beaed4", 50.0001, 60.0001),
    new RangeLabel("background-color:#fdc086", 60.0001, 70.0001),
    new RangeLabel("background-color:#ffff99", 70.0001, 80.0001),
    new RangeLabel("background-color:#386cb0", 80.0001, 90.0001),
    new RangeLabel("background-color:#f0027f", 90.0001, 100.0001),
    new RangeLabel("background-color:#bf5b17", 100.0001, 99999)
 cs = new ColumnSummaryReport("pinchPoints", 
                           "Habitat - Ecological pinch points", 
                           "Summary of habitat target achievement");
See Also:
  • Field Details

    • TYPES

      public static final String[] TYPES
      This field describes the multiple renderings that are supported by the report. In this case the report supports html, csv, and png.
  • Constructor Details

    • ColumnSummaryReport

      public ColumnSummaryReport(String filename, String title, String units, AttributeStore sourceDataTable, String reselect, String label, String expression, String formatExpression, RangeLabel[] cellFormats, String additionalHTML)
      The ColumnSummaryReport constructor.
      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. The report will add ".html", ".png", or ".csv" as appropriate.
      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.
      units - The units of measure to be displayed on the Y-axis of the PNG sub-report.
      sourceDataTable - The table containing the data to be summarized.
      reselect - A query string that selects the records from the source table that will be used in this report.
      label - The name of a column in the table that will be used to label each row in the output table.
      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.
      formatExpression - An expression describing the data value to be used to look up the format code from the cellFormats parameter.
      cellFormats - An array of range labels that are used to apply formatting to the cells of the table. The label should be a valid CSS style value that will be applied to the cell in the table.
      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.
  • Method Details

    • getUnits

      public String getUnits()
    • setUnits

      public void setUnits(String units)
    • getReselectExpression

      public String getReselectExpression()
    • setReselectExpression

      public void setReselectExpression(String expression)
    • getLabel

      public String getLabel()
    • setLabel

      public void setLabel(String label)
    • setExpression

      public void setExpression(String expression)
    • getExpression

      public String getExpression()
    • setFormatExpression

      public void setFormatExpression(String expression)
    • getFormatExpression

      public String getFormatExpression()
    • getHTMLText

      public String getHTMLText()
    • setHTMLText

      public void setHTMLText(String text)
    • getCellFormats

      public RangeLabel[] getCellFormats()
    • setCellFormats

      public void setCellFormats(RangeLabel[] cats)
    • doReport

      public ca.spatial.reportwriter.Report.DataCache doReport(String filename, PrintStream out, Map<String,​Object> param, ca.spatial.reportwriter.Report.DataCache cache)
      Description copied from class: Report
      The method used by the report writer to format the requested report. This method is implemented in every custom report. Application programs generally do not need to call this method, but instead use the report writer methods to obtain reports.
      Specified by:
      doReport in class Report
      filename - The full name of the report to be printed, including the extension of the sub-report (if any).
      out - The output stream to print output on to.
      param - A HashMap containing parameters that modify the report (for example the scenario name).
    • getTypes

      public String[] getTypes()
      Description copied from class: Report
      An accessor function to retrieve the list of report types supported by this report. See the documentation for the TYPES variable for the list of sub-types.
      Specified by:
      getTypes in class Report