Difference between revisions of "Using JasperReports with opentaps"
m (Protected "Using JasperReports with opentaps": Sysop page [edit=sysop:move=sysop]) |
|||
Line 1: | Line 1: | ||
− | opentaps | + | With opentaps, you can define reports with [http://jasperreports.sourceforge.net/ JasperReports] either manually or using the [http://www.jasperforge.org/sf/projects/ireport iReport] report writer and then upload them to the opentaps server for processing. |
+ | |||
+ | To use Jasper in your custom application you should incorporate the view handler in your controller.xml: | ||
<handler name="jasperreports" type="view" class="org.opentaps.common.reporting.jasper.JasperReportsViewHandler"/> | <handler name="jasperreports" type="view" class="org.opentaps.common.reporting.jasper.JasperReportsViewHandler"/> | ||
− | Then, | + | This view handler will render the jasper reports XML file in a variety of formats available. Then, upload your reports into the opentaps webapp/ in a sub-directory and define view-map for your report: |
<view-map name="MyReport" type="jasperreports" page="/reports/MyReport.jrxml" content-type="application/pdf" encoding="none"/> | <view-map name="MyReport" type="jasperreports" page="/reports/MyReport.jrxml" content-type="application/pdf" encoding="none"/> | ||
− | Possible values for content-type are application/pdf, text/html, text/csv, application/rtf, text/plain, application/vnd.oasis.opendocument.text | + | Possible values for content-type are application/pdf, text/html, text/csv, application/rtf, text/plain, application/vnd.oasis.opendocument.text This is a default content type in case the report itself does not specify one. |
+ | |||
+ | When the report is run on the opentaps server, the data could be prepared by a beanshell (.bsh) script and generated using the entity engine. This would override the SQL in the jrxml itself. You can also reference internationalized UI labels within your jasper reports by using $R{...} syntax, such as: | ||
+ | |||
+ | $R{FinancialsReport.TotalSales.Title} | ||
+ | |||
+ | which would reference the FinancialsReport.TotalSales.Title in the FinancialUILabels.properties file. |
Revision as of 21:49, 25 October 2007
With opentaps, you can define reports with JasperReports either manually or using the iReport report writer and then upload them to the opentaps server for processing.
To use Jasper in your custom application you should incorporate the view handler in your controller.xml:
<handler name="jasperreports" type="view" class="org.opentaps.common.reporting.jasper.JasperReportsViewHandler"/>
This view handler will render the jasper reports XML file in a variety of formats available. Then, upload your reports into the opentaps webapp/ in a sub-directory and define view-map for your report:
<view-map name="MyReport" type="jasperreports" page="/reports/MyReport.jrxml" content-type="application/pdf" encoding="none"/>
Possible values for content-type are application/pdf, text/html, text/csv, application/rtf, text/plain, application/vnd.oasis.opendocument.text This is a default content type in case the report itself does not specify one.
When the report is run on the opentaps server, the data could be prepared by a beanshell (.bsh) script and generated using the entity engine. This would override the SQL in the jrxml itself. You can also reference internationalized UI labels within your jasper reports by using $R{...} syntax, such as:
$R{FinancialsReport.TotalSales.Title}
which would reference the FinancialsReport.TotalSales.Title in the FinancialUILabels.properties file.