public class StaticReportDataSource extends java.lang.Object implements ReportDataSource
Author: Perry
This class provides a static data source to a report resource.
| Modifier and Type | Class and Description |
|---|---|
protected class |
StaticReportDataSource.NumberConvertingDatasetBuilder
This Convenience Builder will look through all the rows of a given column, trying to parse the values as Numbers.
|
| Constructor and Description |
|---|
StaticReportDataSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
gatherData(ReportExecutionContext context,
java.io.Serializable aConfigObject,
java.util.Map<java.lang.String,java.lang.Object> extraConfigs)
Called when a report is being executed to gather the data represented by this data source.
|
java.lang.String |
getId()
Return the unique ID for this data source.
|
static java.util.List |
toList(JSONArray array) |
static java.util.Map |
toMap(JSONObject object) |
public void gatherData(ReportExecutionContext context, java.io.Serializable aConfigObject, java.util.Map<java.lang.String,java.lang.Object> extraConfigs) throws java.lang.Exception
ReportDataSourcegatherData in interface ReportDataSourcecontext - This context holds the data map for the report, as well as other information about the
report, its project, logging context, status feedback, etc.aConfigObject - The object that was saved for this data source in the designer.extraConfigs - Any extra info datasources might need when running. Will be null if not sample data. It's up
to the datasource to decide what object(s) from this map it wants. Key is the datasource id.java.lang.Exceptionpublic java.lang.String getId()
ReportDataSourcegetId in interface ReportDataSourcepublic static java.util.Map toMap(JSONObject object) throws JSONException
JSONExceptionpublic static java.util.List toList(JSONArray array) throws JSONException
JSONException