The package XLIB_JASPERREPORTS is the interface which accepts the parameters, generates the url and calls the integration on the locally installed Apache Tomcat server.
e.g.:
begin
xlib_jasperreports.set_report_url('http://localhost:8080/JasperReportsIntegration/report');
xlib_jasperreports.show_report (p_rep_name => :p5_rep_name,
p_rep_format
=> :p5_rep_format,
p_data_source
=> :p5_data_source,
p_out_filename
=> :p5_out_filename,
p_rep_locale
=> :p5_rep_locale,
p_rep_encoding
=> :p5_rep_encoding,
p_additional_params
=> :p5_additional_params);
-- stop rendering of the current APEX page
apex_application.g_unrecoverable_error := true;
end;
Here is a description of the input parameters:
parameter | description | default value | required? |
---|---|---|---|
_repName | specifies the report name | test | * |
_repFormat | the report format, e.g. pdf, html, rtf, xls, jxl, csv | * |
|
_dataSource | entry from the context.xml file, e.g. test, default, test2 | default | * |
_outFilename | a filename can be specified for the download for the "save as" dialog | ||
_repLocale | Locale string, composed of the |
de_DE | |
_repEncoding | the "charset" parameter for the content_type, a list of valid entries can be found here. |
UTF-8 | |
additional parameters | all parameters are passed directly to the report (excluding the the internal ones (prefixed with "_") |
New reports will have to be stored on the application server. Copy the report.jasper file into the directory TOMCAT_HOME/webapps/JasperReportsIntegration/reports/. You can also create a subdirectory under reports and put the files there. Make sure to reference the file correctly, see the test application for samples.
You can specify input parameters for the reports and use them as a filter. They have to be defined as STRING, they cannot be number or any other data type. This is due to how the integration calls the reports. See the report demo/orders.jrxml or demo/top_orders.jrxml as a sample. Both use the input parameter pAppUser for filtering the data set.