Package com.inet.report
Class EngineBundle
java.lang.Object
com.inet.report.EngineBundle
- All Implemented Interfaces:
ReportGenerator
A bundle of multiple engines you want to render as one document. In the report URL the "reports" parameter can be used to set multiple reports you want to render as one, separated by semi-colon.
- Since:
- 15.0
-
Constructor Summary
ConstructorDescriptionEngineBundle
(String format) Create a new bundle of reports for the specified output format. -
Method Summary
Modifier and TypeMethodDescriptionaddReportFile
(String reportUrl) Add a new report template to this bundle and creates an engine.void
execute()
SeeEngine.execute()
for details.Get the first Engine from the bundle list.Get all Engines of this bundle.int
SeeEngine.getPageCount()
for details.byte[]
getPageData
(int page) SeeEngine.getPageData(int)
for details.getPromptField
(String name) SeeEngine.getPromptField(String)
for details.@Nonnull EngineStatistics
SeeEngine.getStatistics()
for details.void
setClientLocale
(@Nonnull Locale locale) SeeEngine.setClientLocale(Locale)
for details.void
setDocumentOutput
(DocumentOutput documentOutput) Set the output location for the rendered data.void
NOTE: UnlikeEngine.setPrompt(String, int)
, the number i does not refer to prompt i in any engine, but will count from the first engine onwards.void
SeeEngine.setPrompt(String, String)
for details.void
setUserProperties
(Properties props) SeeEngine.setUserProperties(Properties)
for details.void
SeeEngine.stop(String)
for details.void
stopAfterPage
(int maxPageNo) SeeEngine.stopAfterPage(int)
for details.
-
Constructor Details
-
EngineBundle
Create a new bundle of reports for the specified output format.- Parameters:
format
- One of the constant form Engine.- Throws:
ReportException
- if the format is not supported because it is tabular- Since:
- 15.0
-
-
Method Details
-
addReportFile
Add a new report template to this bundle and creates an engine.- Parameters:
reportUrl
- the report URL or file path to the *.rpt template.- Returns:
- the created engine
- Throws:
ReportException
- if the file can not be loaded or the format is currently not supported- Since:
- 15.0
-
setDocumentOutput
Set the output location for the rendered data. By default the memory (heap) is used. It is also possible to store the data into the report cache or stream it directly to an OutputStream. This must be set before call of execute().- Specified by:
setDocumentOutput
in interfaceReportGenerator
- Parameters:
documentOutput
- The location for the data. This can be DocumentOutputStream or CachedOutput.
-
execute
SeeEngine.execute()
for details.- Specified by:
execute
in interfaceReportGenerator
- Throws:
ReportException
- if Engine is not initialized or finished.- See Also:
-
getEngine0
Get the first Engine from the bundle list.- Returns:
- the Engine with index 0
- Throws:
ReportException
- if no rpt file was set.- Since:
- 17.0
-
getEngines
Get all Engines of this bundle.- Returns:
- the engines
- Since:
- 17.0
-
getPageCount
SeeEngine.getPageCount()
for details.- Specified by:
getPageCount
in interfaceReportGenerator
- Returns:
- number of pages or chunks
- Throws:
ReportException
- If rendering the report encounters a problem
-
getPageData
SeeEngine.getPageData(int)
for details.- Specified by:
getPageData
in interfaceReportGenerator
- Parameters:
page
- The number of the page. The first page is 1, the second is 2, ... . If the page number is bigger than the page count then null will be returned.- Returns:
- the binary data for the Java Viewer or the bytes of the exported file (page).
- Throws:
ReportException
- If rendering the page encounters a problem
-
stop
SeeEngine.stop(String)
for details.- Specified by:
stop
in interfaceReportGenerator
- Parameters:
message
- a message for the debug log.
-
getStatistics
SeeEngine.getStatistics()
for details.- Specified by:
getStatistics
in interfaceReportGenerator
- Returns:
- the statistic
-
setUserProperties
SeeEngine.setUserProperties(Properties)
for details.- Specified by:
setUserProperties
in interfaceReportGenerator
- Parameters:
props
- The data to be set in a Properties object.- Throws:
ReportException
- if Engine is not initialized or finished.
-
setClientLocale
SeeEngine.setClientLocale(Locale)
for details.- Specified by:
setClientLocale
in interfaceReportGenerator
- Parameters:
locale
- The locale to be used by the client- Throws:
ReportException
- if Engine is not initialized or finished.
-
stopAfterPage
public void stopAfterPage(int maxPageNo) SeeEngine.stopAfterPage(int)
for details.- Specified by:
stopAfterPage
in interfaceReportGenerator
- Parameters:
maxPageNo
- The last page that should be rendered. 0 means "unlimited".
-
setPrompt
SeeEngine.setPrompt(String, String)
for details.- Specified by:
setPrompt
in interfaceReportGenerator
- Parameters:
name
- the name of the parameter fieldprompt
- value for parameter field as String- Throws:
ReportException
- if Engine is not initialized or finished.
-
getPromptField
SeeEngine.getPromptField(String)
for details.- Specified by:
getPromptField
in interfaceReportGenerator
- Parameters:
name
- name of the prompt to fetch- Returns:
- PromptField by the given name in this Report, or null if none exists
- Throws:
ReportException
- if Engine is not initialized or finished.
-
setPrompt
NOTE: UnlikeEngine.setPrompt(String, int)
, the number i does not refer to prompt i in any engine, but will count from the first engine onwards. So if there are three engines with five prompts each, i=12 will set the third prompt in the third engine. SeeEngine.setPrompt(String, int)
for details.- Specified by:
setPrompt
in interfaceReportGenerator
- Parameters:
prompt
- value for parameter field ii
- index in the parameter list- Throws:
ReportException
- if Engine is not initialized or finished.
-