Package ca.spatial.reportwriter
Class ColumnSummaryReport
java.lang.Object
ca.spatial.reportwriter.Report
ca.spatial.reportwriter.ColumnSummaryReport
- All Implemented Interfaces:
Selectable<Report>
,Comparable<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", "%", control.getTargetTable(), "startsWith(TARGET,'feature.Habitat.')", "TARGET", "100*CURRENT/MINIMUM", "100*CURRENT/MINIMUM", cellFormats, "Summary of habitat target achievement"); reportWriter.addReport(cs)
- See Also:
ReportWriter
-
Nested Class Summary
Nested classes/interfaces inherited from class ca.spatial.reportwriter.Report
Report.GetNodesAt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String[]
This field describes the multiple renderings that are supported by the report.Fields inherited from class ca.spatial.reportwriter.Report
AREA, LINE, PIE, SIDE_BY_SIDE_BARS, STACKED_BARS
-
Constructor Summary
ConstructorsConstructorDescriptionColumnSummaryReport(String filename, String title, String units, AttributeStore sourceDataTable, String reselect, String label, String expression, String formatExpression, RangeLabel[] cellFormats, String additionalHTML)
The ColumnSummaryReport 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.getLabel()
String[]
getTypes()
An accessor function to retrieve the list of report types supported by this report.getUnits()
void
setCellFormats(RangeLabel[] cats)
void
setExpression(String expression)
void
setFormatExpression(String expression)
void
setHTMLText(String text)
void
void
setReselectExpression(String expression)
void
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
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.- 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 ".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 thesourceDataTable
.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
-
setUnits
-
getReselectExpression
-
setReselectExpression
-
getLabel
-
setLabel
-
setExpression
-
getExpression
-
setFormatExpression
-
getFormatExpression
-
getHTMLText
-
setHTMLText
-
getCellFormats
-
setCellFormats
-
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.
-