Module is.codion.framework.domain
Interface Report<T,P extends @Nullable Object,R>
- Type Parameters:
T- the report typeP- the report parameters type, nullable where the report may be filled without parametersR- the report result type
- All Known Subinterfaces:
JRReport<R>
- All Known Implementing Classes:
AbstractReport
A wrapper for a report
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<Boolean> Specifies whether to cache reports when loaded from disk/network, this prevents "hot deploy" of reports Value type: Boolean Default value: truestatic final PropertyValue<String> The report path used for file based report generation. -
Method Summary
Modifier and TypeMethodDescriptionbooleancached()voidClears the report cache, if caching is not enabled calling this method has no effectfill(Connection connection, P parameters) Loads and fills the report using the given database connection.static StringfullReportPath(String reportPath) Returns a full report path, combined from the report location specified byREPORT_PATHand the given report path.load()Loads the report this report wrapper is based on.static String
-
Field Details
-
REPORT_PATH
The report path used for file based report generation.- Value type: String
- Default value: null
-
CACHE_REPORTS
Specifies whether to cache reports when loaded from disk/network, this prevents "hot deploy" of reports- Value type: Boolean
- Default value: true
-
-
Method Details
-
fill
Loads and fills the report using the given database connection.The connection is the JDBC connection of the entity connection filling the report, on the server when the entity connection is remote. Filling runs within its transaction handling, inside a transaction when one is open, the connection committed afterwards when none is, so the report must not commit, roll back or close it.
A report based on entities rather than on SQL is filled in the client instead, from the entities it has, selecting any more via the entity connection as it fills. Where the client can not host the reporting engine, a database function, which receives the entity connection, can fill and export it on the server, see
FunctionType.- Parameters:
connection- the connection to use for the report generationparameters- the report parameters- Returns:
- a filled report ready for display
- Throws:
ReportException- in case of an exception
-
load
T load()Loads the report this report wrapper is based on.- Returns:
- a loaded report object
- Throws:
ReportException- in case of an exception
-
cached
boolean cached()- Returns:
- true if this report has been cached
-
clearCache
void clearCache()Clears the report cache, if caching is not enabled calling this method has no effect -
reportPath
- Returns:
- the value associated with
REPORT_PATH - Throws:
NoSuchElementException- in case it is not specified
-
fullReportPath
Returns a full report path, combined from the report location specified byREPORT_PATHand the given report path.- Parameters:
reportPath- the report path relative toREPORT_PATH.- Returns:
- a full report path
- Throws:
NoSuchElementException- in caseREPORT_PATHis not specified
-