public abstract class BaseDataFactory extends java.lang.Object implements DataFactory
Modifier | Constructor and Description |
---|---|
protected |
BaseDataFactory()
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
fetchData(Engine engine,
FetchTables fetchTables,
DataCollector collector)
Fetches the part of the report data for which this data factory is responsible.
|
java.util.List<ColumnInfo> |
getColumns(TableSource ts)
Returns the column information for a TableSource
|
protected java.util.List<ColumnInfo> |
getColumns(Datasource datasource,
java.lang.String catalog,
java.lang.String schema,
java.lang.String name,
int type)
Returns the column information for a TableSource
|
com.inet.report.DatabaseConfiguration |
getConfiguration()
Returns the DatabaseConfiguration of this DataFactory.
|
boolean |
getReportDataPerInstance()
Override this method only if you use subreport(s) and you set the
data for the report with the getReportData or
DataFactory.fetchData(Engine, FetchTables, DataCollector) method. |
TableData |
getTableSourceData(TableSource ts)
Is called from getReportData to request the data of a single TableSource if the TableSource is not a joined table or view.
|
protected TableData |
getTableSourceData(TableSource ts,
java.util.List<DatabaseField> columns)
Is called from getTableSourceData to request the data of a single
TableSource if the TableSource
is not a joined table or view. |
protected TableData |
getTableSourceData(TableSource ts,
java.util.ArrayList<DatabaseField> columns)
Deprecated.
As of i-net Clear Reports 15.1, replaced by
getTableSourceData(TableSource, List) |
void |
setConfiguration(com.inet.report.DatabaseConfiguration configuration)
Sets the DatabaseConfiguration for this DataFactory. this is calling from the runtime after creating.
|
getTableSourceInfos
protected BaseDataFactory()
public boolean getReportDataPerInstance()
DataFactory.fetchData(Engine, FetchTables, DataCollector)
method.
For more information please refer to the sample Main_and_Subreport_Data_WithExternalResultSet.java.getReportDataPerInstance
in interface DataFactory
public com.inet.report.DatabaseConfiguration getConfiguration()
getConfiguration
in interface DataFactory
public void setConfiguration(@Nonnull com.inet.report.DatabaseConfiguration configuration)
setConfiguration
in interface DataFactory
configuration
- the current configurationpublic TableData getTableSourceData(@Nonnull TableSource ts) throws ReportException
getTableSourceData
in interface DataFactory
ts
- The current table sourceReportException
- if error occurs in the API accessprotected TableData getTableSourceData(@Nonnull TableSource ts, @Nonnull java.util.List<DatabaseField> columns) throws ReportException
TableSource
if the TableSource
is not a joined table or view. So it's called for procedures, commands and single tables or views.getTableSourceData(TableSource)
- the
default implementation of this method will always throw a ReportException
ts
- the table source to get the data forcolumns
- the columns of the table source to get the data fornull
ReportException
- in case an error occurs during the API access or if this method is not implemented@Deprecated protected TableData getTableSourceData(@Nonnull TableSource ts, @Nonnull java.util.ArrayList<DatabaseField> columns) throws ReportException
getTableSourceData(TableSource, List)
TableSource
if the TableSource
is not a joined table or view. So it's called for procedures, commands and single tables or views.getTableSourceData(TableSource)
- the
default implementation of this method will always throw a ReportException
ts
- the table source to get the data forcolumns
- the columns of the table source to get the data fornull
ReportException
- in case an error occurs during the API access or if this method is not implemented@Nonnull public java.util.List<ColumnInfo> getColumns(@Nonnull TableSource ts) throws ReportException
getColumns
in interface DataFactory
ts
- the table source to get the data forReportException
- if any error occurs@Nonnull protected java.util.List<ColumnInfo> getColumns(@Nonnull Datasource datasource, java.lang.String catalog, java.lang.String schema, java.lang.String name, int type) throws ReportException
datasource
- The Datasource containing the Connection.catalog
- The catalog/database.schema
- The object owner/schema or null.name
- The object name.type
- The type of sourceReportException
- if any error occurspublic void fetchData(Engine engine, FetchTables fetchTables, DataCollector collector) throws ReportException
FetchTables
instance. The resulting fetched
data is put to the specified DataCollector
during execution of this method.
An example implementation for this method:
for( TableSource tableSource : fetchDef.getTableSources() ) {
TableData tableData;
// retrieve data for table source "tableSource"
tableData = [...]
// deliver the data to the collector:
collector.addUnjoinedData( tableSource, tableData );
}
fetchData
in interface DataFactory
engine
- the engine of the report to renderfetchTables
- a model of joining table describing the data this data factory needs to delivercollector
- the collector which receives any resulting dataReportException
- on failures during data fetchingCopyright © 1999-2020 by i-net software GmbH