class JasperReportWrapper extends java.lang.Object implements FwdReport
Modifier and Type | Field and Description |
---|---|
private JasperDataSource |
dataSource
Data source used by this report.
|
private java.lang.String |
designFileName
File name of the report design file.
|
private java.lang.Long |
id
The resource ID.
|
private static int |
OUTPUT_BUFFER_SIZE
Buffer size for exporting report to a file.
|
private java.util.Map<java.lang.String,BaseDataType> |
parameters
Report parameters (the ones which were set in 4GL code).
|
Constructor and Description |
---|
JasperReportWrapper() |
Modifier and Type | Method and Description |
---|---|
logical |
exportReport(character outputFileName,
MediaType outputFormat)
Run report end export result using the specified format to the specified file.
|
logical |
exportReportCsv(character fileName)
Run report end export result to the CSV file.
|
logical |
exportReportCsv(java.lang.String fileName)
Run report end export result to the CSV file.
|
logical |
exportReportPdf(character fileName)
Run report end export result to the PDF file.
|
logical |
exportReportPdf(java.lang.String fileName)
Run report end export result to the PDF file.
|
logical |
exportReportXls(character fileName)
Run report end export result to the XLS file.
|
logical |
exportReportXls(java.lang.String fileName)
Run report end export result to the XLS file.
|
logical |
exportReportXlsx(character fileName)
Run report end export result to the XLSX file.
|
logical |
exportReportXlsx(java.lang.String fileName)
Run report end export result to the XLSX file.
|
(package private) static java.lang.Object |
getJavaValue(BaseDataType value,
java.lang.Class<?> jasperValueClass)
Get Jasper-compatible value from the 4GL-compatible value.
|
handle |
getReportDataSource()
Get the data source used by this report.
|
character |
getReportDesign()
Get the name of the report design file.
|
java.lang.Long |
id()
Get this resource's ID, if is already set.
|
void |
id(long id)
Set this resource's ID.
|
void |
setReportDataSource(handle dataSource)
Set the data source used by this report.
|
void |
setReportDataSource(QueryWrapper dataSource)
Set the query used as the data source by this report.
|
void |
setReportDesign(character designFileName)
Set report design file.
|
void |
setReportDesign(java.lang.String designFileName)
Set report design file.
|
logical |
setReportParameter(character param,
BaseDataType value)
Set the parameter used by the report.
|
logical |
setReportParameter(java.lang.String param,
BaseDataType value)
Set the parameter used by the report.
|
logical |
setReportParameter(java.lang.String param,
java.lang.String value)
Set the parameter used by the report.
|
boolean |
unknown()
Reports if this object is unknown.
|
boolean |
valid()
Reports if this object is valid for use.
|
private static final int OUTPUT_BUFFER_SIZE
private java.util.Map<java.lang.String,BaseDataType> parameters
private JasperDataSource dataSource
private java.lang.String designFileName
private java.lang.Long id
static java.lang.Object getJavaValue(BaseDataType value, java.lang.Class<?> jasperValueClass)
value
- 4GL-compatible valuejasperValueClass
- Expected Jasper-compatible data type.java.lang.IllegalArgumentException
- If 4GL-compatible data type is not supported or doesn't match expected
Jasper-compatible data type.public logical setReportParameter(java.lang.String param, BaseDataType value)
setReportParameter
in interface FwdReport
param
- Name of the parameter.value
- Value of the parameter.true
on success.public logical setReportParameter(java.lang.String param, java.lang.String value)
setReportParameter
in interface FwdReport
param
- Name of the parameter.value
- Value of the parameter.true
on success.public logical setReportParameter(character param, BaseDataType value)
setReportParameter
in interface FwdReport
param
- Name of the parameter.value
- Value of the parameter.true
on success.public logical exportReportPdf(java.lang.String fileName)
exportReportPdf
in interface FwdReport
fileName
- Name of the output PDF file.true
on success.public logical exportReportPdf(character fileName)
exportReportPdf
in interface FwdReport
fileName
- Name of the output PDF file.true
on success.public logical exportReportXls(java.lang.String fileName)
exportReportXls
in interface FwdReport
fileName
- Name of the output XLS file.true
on success.public logical exportReportXls(character fileName)
exportReportXls
in interface FwdReport
fileName
- Name of the output XLS file.true
on success.public logical exportReportXlsx(java.lang.String fileName)
exportReportXlsx
in interface FwdReport
fileName
- Name of the output XLSX file.true
on success.public logical exportReportXlsx(character fileName)
exportReportXlsx
in interface FwdReport
fileName
- Name of the output XLSX file.true
on success.public logical exportReportCsv(java.lang.String fileName)
exportReportCsv
in interface FwdReport
fileName
- Name of the output CSV file.true
on success.public logical exportReportCsv(character fileName)
exportReportCsv
in interface FwdReport
fileName
- Name of the output CSV file.true
on success.public void setReportDesign(character designFileName)
setReportDesign
in interface FwdReport
designFileName
- Name of the report design file.public void setReportDesign(java.lang.String designFileName)
setReportDesign
in interface FwdReport
designFileName
- Name of the report design file.public character getReportDesign()
getReportDesign
in interface FwdReport
public void setReportDataSource(handle dataSource)
setReportDataSource
in interface FwdReport
dataSource
- Handle to the data source.public void setReportDataSource(QueryWrapper dataSource)
setReportDataSource
in interface FwdReport
dataSource
- Handle to the query used as the data source by this report.public handle getReportDataSource()
getReportDataSource
in interface FwdReport
public boolean valid()
valid
in interface WrappedResource
true
.public boolean unknown()
unknown
in interface WrappedResource
false
.public java.lang.Long id()
This is for internal usage only. If you need the resource ID, use
handle.resourceId(com.goldencode.p2j.util.WrappedResource)
, which will compute it and save it at the resource, too.
id
in interface WrappedResource
null
if not set.public void id(long id)
id
in interface WrappedResource
id
- The resource's ID.public logical exportReport(character outputFileName, MediaType outputFormat)
exportReport
in interface FwdReport
outputFileName
- Name of the output file.outputFormat
- Output format (e.g. PDF).true
on success.