Class TableQueryReport

java.lang.Object
ca.spatial.reportwriter.Report
ca.spatial.reportwriter.TableQueryReport
All Implemented Interfaces:
Selectable<Report>, Comparable<Report>

public class TableQueryReport extends Report
The TableQueryReport class creates a CSV file that contain a single record for each selected record in the input table, for each requested planning period. The report constructor defines the base table, a reselection query that is used to restrict the set of records of interest, an array of expressions (one for each column in the output table), an array of column headings, and an array of periods that the report should represent.

This report produces a single CSV file.

See Also:
Report, ReportWriter
  • Field Details

    • TYPES

      public static final String[] TYPES
  • Constructor Details

    • TableQueryReport

      public TableQueryReport(String filename, String title, AttributeStore sourceDataTable, String query, String[] expressions, String[] columnNames, int[] periods)
      The TableQueryReport constructor.
      Parameters:
      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 ".csv".
      title - The title to be displayed in the ReportWriter catalog.
      sourceDataTable - The table containing the data to be summarized.
      query - An expression describing the reselection criteria used to restrict records in the output file. The expression can refer to any column in the sourceDataTable.
      expressions - An array of expressions representing the columns that should be present in the output file.
      columnNames - A list of names to be used for column headings.
      periods - An array of integers indicating the periods that should be accumulated into the output file.
    • TableQueryReport

      public TableQueryReport(String filename, String title, AttributeStore sourceDataTable, String query, String[] expressions, int[] periods)
      The TableQueryReport constructor. This constructor is the same as the full constructor. The only difference is that the column headings will be the same as the values of the expression parameter.
  • Method Details

    • getReselectExpression

      public String getReselectExpression()
    • setReselectExpression

      public void setReselectExpression(String query)
    • getColumnNames

      public String[] getColumnNames()
    • setColumnNames

      public void setColumnNames(String[] columnNames)
    • getExpressions

      public String[] getExpressions()
    • setExpressions

      public void setExpressions(String[] expressions)
    • getPeriods

      public int[] getPeriods()
    • setPeriods

      public void setPeriods(int[] p)
    • setUseStandard

      public TableQueryReport setUseStandard(boolean state)
      Set a flag to indicate if the standard columns should be added to this report. The standard columns are PERIOD, YEAR and PERIODWIDTH.
      Parameters:
      state - if true add these columns. The default state is true.
    • getUseStandard

      public boolean getUseStandard()
    • 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
      Parameters:
      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