public class FluentReportRunner
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
FluentReportRunner |
computeCount(boolean count)
Set compute count property : default this property is false because this computation
takes time
|
FluentReportRunner |
connectTo(java.sql.Connection connection)
Set the connection to database
|
FluentReportRunner |
connectToCsv(java.sql.Connection connection)
Set the connection to csv file
|
ro.nextreports.engine.queryexec.QueryResult |
executeQuery()
Execute query
This method is useful in case you are not interested about report layout,
but only query and you want to make your own business and not to call run method
|
FluentReportRunner |
formatAs(java.lang.String format)
Set the output format
|
java.util.Map<java.lang.String,java.lang.Object> |
getParameterValues()
Get parameters values
Values for dynamic parameters are set at runtime
|
boolean |
isCancelled()
See if runner is cancelled
|
FluentReportRunner |
registerListener(ro.nextreports.engine.exporter.event.ExporterEventListener listener)
Register a listener
|
static FluentReportRunner |
report(Report report)
Create a FluentReportRunner object
|
void |
run(java.io.OutputStream stream)
Export the current report to the specified output format
|
void |
stop()
Stop the export process
|
FluentReportRunner |
unregisterListener(ro.nextreports.engine.exporter.event.ExporterEventListener listener)
Unregister a listener
|
FluentReportRunner |
withAlerts(java.util.List<ro.nextreports.engine.exporter.Alert> alerts)
Set an alert
|
FluentReportRunner |
withChartImagePath(java.lang.String path)
Set path to folder where chart generated images will be saved
|
FluentReportRunner |
withLanguage(java.lang.String language)
Set language for internationalized reports
Language string is computed as :
locale.getLanguage() + "_" + locale.getCountry()
|
FluentReportRunner |
withParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
Set the parameters values
|
FluentReportRunner |
withQueryTimeout(int queryTimeout)
Set the query timeout
|
public static FluentReportRunner report(Report report)
report
- next report objectpublic FluentReportRunner connectTo(java.sql.Connection connection)
connection
- database connectionpublic FluentReportRunner connectToCsv(java.sql.Connection connection)
connection
- csv file connectionpublic FluentReportRunner withQueryTimeout(int queryTimeout)
queryTimeout
- database execution query timeout in secondspublic FluentReportRunner withParameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
parameterValues
- map of parameters values where the key is the parameter name
and the value is the parameter value(s)
Such parameter value can be a simple java object if the parameter has SINGLE SELECTION,
or in case of MULTIPLE SELECTION value is an array Object[] of java objects. For an empty
list of values , the value must be : new Object[]{ParameterUtil.NULL}
If we programatically add value(s) in parameterValues for a hidden parameter, the default values
for that hidden parameter will be ignored and the engine will use those from the map.public FluentReportRunner withChartImagePath(java.lang.String path)
path
- folder pathpublic FluentReportRunner withLanguage(java.lang.String language)
language
- languagepublic FluentReportRunner formatAs(java.lang.String format)
format
- output format : ReportRunner.PDF_FORMAT, ReportRunner.EXCEL_FROMAT
ReportRunner.HTML_FORMAT, ReportRunner.RTF_FORMAT, ReportRunner.CSV_FORMAT, ReportRunner.TSV_FROMATpublic FluentReportRunner withAlerts(java.util.List<ro.nextreports.engine.exporter.Alert> alerts)
alerts
- alerts listpublic FluentReportRunner computeCount(boolean count)
count
- true means the count will be computedpublic FluentReportRunner registerListener(ro.nextreports.engine.exporter.event.ExporterEventListener listener)
listener
- exporter event listenerpublic FluentReportRunner unregisterListener(ro.nextreports.engine.exporter.event.ExporterEventListener listener)
listener
- exporter event listenerpublic void run(java.io.OutputStream stream) throws ReportRunnerException, ro.nextreports.engine.exporter.exception.NoDataFoundException
stream
- output stream to write the exported reportReportRunnerException
- if FluentReportRunner object is not correctly configuredro.nextreports.engine.exporter.exception.NoDataFoundException
- if no data is foundpublic ro.nextreports.engine.queryexec.QueryResult executeQuery() throws ReportRunnerException, java.lang.InterruptedException
ReportRunnerException
- if Runner object is not correctly configuredjava.lang.InterruptedException
- if process was interruptedpublic void stop()
public boolean isCancelled()
public java.util.Map<java.lang.String,java.lang.Object> getParameterValues()