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 |
---|---|
void |
addChart()
Starts to prepare data for new chart.
|
void |
chartAddPicture(character pictName,
int x,
int y,
int w,
int h)
Gets the total rows range of the report sheet.
|
void |
chartAddPicture(java.lang.String pictName,
int x,
int y,
int w,
int h)
Gets the total rows range of the report sheet.
|
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 |
exportReportDocx(character fileName)
Run report end export result to the DOCX file.
|
logical |
exportReportDocx(java.lang.String fileName)
Run report end export result to the DOCX file.
|
logical |
exportReportHtml(character fileName)
Run report end export result to the HTML file.
|
logical |
exportReportHtml(java.lang.String fileName)
Run report end export result to the HTML 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 |
exportReportRtf(character fileName)
Run report end export result to the RTF file.
|
logical |
exportReportRtf(java.lang.String fileName)
Run report end export result to the RTF 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.
|
integer |
getSheetRangeColumns(character sheetName)
Gets the total coluns range of the report sheet.
|
integer |
getSheetRangeColumns(java.lang.String sheetName)
Gets the total coluns range of the report sheet.
|
integer |
getSheetRangeRows(character sheetName)
Gets the total rows range of the report sheet.
|
integer |
getSheetRangeRows(java.lang.String sheetName)
Gets the total rows range of the report sheet.
|
java.lang.Long |
id()
Get this resource's ID, if is already set.
|
void |
id(long id)
Set this resource's ID.
|
logical |
importCsvDataSource(character fileName)
Import CSV file as data source for report generation.
|
logical |
importCsvDataSource(java.lang.String fileName)
Import CSV file as data source for report generation.
|
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 exportReportRtf(java.lang.String fileName)
exportReportRtf
in interface FwdReport
fileName
- Name of the output RTF file.true
on success.public logical exportReportRtf(character fileName)
exportReportRtf
in interface FwdReport
fileName
- Name of the output RTF file.true
on success.public logical exportReportDocx(java.lang.String fileName)
exportReportDocx
in interface FwdReport
fileName
- Name of the output DOCX file.true
on success.public logical exportReportDocx(character fileName)
exportReportDocx
in interface FwdReport
fileName
- Name of the output DOCX 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 logical importCsvDataSource(character fileName)
importCsvDataSource
in interface FwdReport
fileName
- Name of the output CSV file.true
on success.public logical importCsvDataSource(java.lang.String fileName)
importCsvDataSource
in interface FwdReport
fileName
- Name of the output CSV file.true
on success.public integer getSheetRangeColumns(character sheetName)
getSheetRangeColumns
in interface FwdReport
sheetName
- The name of the sheet to inspect.public integer getSheetRangeColumns(java.lang.String sheetName)
getSheetRangeColumns
in interface FwdReport
sheetName
- The name of the sheet to inspect.public integer getSheetRangeRows(character sheetName)
getSheetRangeRows
in interface FwdReport
sheetName
- The name of the sheet to inspect.public integer getSheetRangeRows(java.lang.String sheetName)
getSheetRangeRows
in interface FwdReport
sheetName
- The name of the sheet to inspect.public void addChart()
public void chartAddPicture(character pictName, int x, int y, int w, int h)
chartAddPicture
in interface FwdReport
pictName
- The name of the picture file.x
- X position of the picture.y
- Y position of the picture.w
- Width of the picture.h
- Height of the picture.public void chartAddPicture(java.lang.String pictName, int x, int y, int w, int h)
chartAddPicture
in interface FwdReport
pictName
- The name of the picture file.x
- X position of the picture.y
- Y position of the picture.w
- Width of the picture.h
- Height of the picture.public logical exportReportHtml(java.lang.String fileName)
exportReportHtml
in interface FwdReport
fileName
- Name of the output HTML file.true
on success.public logical exportReportHtml(character fileName)
exportReportHtml
in interface FwdReport
fileName
- Name of the output HTML 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.