Package ca.spatial.reportwriter
Class TableQueryReport
java.lang.Object
ca.spatial.reportwriter.Report
ca.spatial.reportwriter.TableQueryReport
- All Implemented Interfaces:
Selectable<Report>
,Comparable<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
-
Nested Class Summary
Nested classes/interfaces inherited from class ca.spatial.reportwriter.Report
Report.GetNodesAt
-
Field Summary
FieldsFields inherited from class ca.spatial.reportwriter.Report
AREA, LINE, PIE, SIDE_BY_SIDE_BARS, STACKED_BARS
-
Constructor Summary
ConstructorsConstructorDescriptionTableQueryReport(String filename, String title, AttributeStore sourceDataTable, String query, String[] expressions, int[] periods)
The TableQueryReport constructor.TableQueryReport(String filename, String title, AttributeStore sourceDataTable, String query, String[] expressions, String[] columnNames, int[] periods)
The TableQueryReport constructor. -
Method Summary
Modifier and TypeMethodDescriptionca.spatial.reportwriter.Report.DataCache
doReport(String filename, PrintStream out, Map<String,Object> param, ca.spatial.reportwriter.Report.DataCache cache)
The method used by the report writer to format the requested report.String[]
String[]
int[]
String[]
getTypes()
An accessor function to retrieve the list of report types supported by this report.boolean
void
setColumnNames(String[] columnNames)
void
setExpressions(String[] expressions)
void
setPeriods(int[] p)
void
setReselectExpression(String query)
setUseStandard(boolean state)
Set a flag to indicate if the standard columns should be added to this report.Methods inherited from class ca.spatial.reportwriter.Report
addDefaultParam, chartImg, compareTo, csvLink, doesAnyTypes, doesCSV, doesGIF, doesHTML, doesPNG, doesType, encodeFileURL, encodeURL, endMainContent, escapeRegexChars, footer, formatColumnHeadings, formatColumnHeadings, getAdditionalFiles, getAttributeStore, getBasepart, getBasepart, getDefaultFilename, getDisplayFormat, getExtension, getExtension, getFilename, getFolderpart, getFolderpart, getLength, getNamepart, getNamepart, getPathToRoot, getReportFor, getTitle, header, htmlText, indexLink, interpolateParams, isDhandler, isIndexed, isSelected, parentIndex, patternToRegex, setAttributeStore, setDefaultParams, setDisplayFormat, setIndexed, setSelected, setTitle, toString, uniqueLabels
-
Field Details
-
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 thesourceDataTable
.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
-
setReselectExpression
-
getColumnNames
-
setColumnNames
-
getExpressions
-
setExpressions
-
getPeriods
public int[] getPeriods() -
setPeriods
public void setPeriods(int[] p) -
setUseStandard
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. -
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.
-