Integration and Usage

Call Interface

The package XLIB_JASPERREPORTS is the interface which accepts the parameters, generates the url and calls the integration on the locally installed J2EE server.


    l_additional_parameters varchar2(32767);


    -- construct addional parameter list
    l_additional_parameters := 'parameter1=' || apex_util.url_encode(:p1_filter_object_name);
    l_additional_parameters := l_additional_parameters || '&parameter2=' || apex_util.url_encode(:p1_filter_object_type);

    -- call the J2EE application and display the returned file
    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   => l_additional_parameters,
          p_print_is_enabled    => case when :p5_print_is_enabled='1' then true else false end,
          p_print_printer_name  => :p5_print_printer_name,
          p_print_media         => :p5_print_media,
          p_print_copies        => :p5_print_copies,
          p_print_duplex        => case when :p5_print_duplex='1' then true else false end,
          p_print_collate       => case when :p5_print_collate='1' then true else false end,
          p_save_is_enabled     => case when :p5_save_is_enabled='1' then true else false end,
          p_save_filename       => :p5_save_filename,
          p_rep_time_zone       => :p5_rep_time_zone

    -- stop rendering of the current APEX page (APEX version up until version 4.0)
    -- apex_application.stop_apex_engine;
    -- stop rendering of the current APEX page (APEX version 4.1 and higher)

Here is a description of the input parameters:

parameter description default value required?
name of the report (needs a name.jasper file deployed on the server) test
format of the generated format: see constants in package XLIB_JASPERREPORTS, e.g. pdf, html, html2, rtf, xls, jxl, csv, xlsx, pptx or docx pdf
p_data_source data source name, needs to be configured application.poperties file
p_out_filename a filename can be specified for the download for the "save as" dialog  

Locale string (e.g. de_DE or en_US), composed of the
ISO language code and
ISO country code


the "charset" parameter for the content_type, a list of valid entries can be found here.
E.g.: ISO-8859-15, UTF-8, Windows-1252

p_additional_parameters all parameters are passed directly to the report (excluding the the internal ones (prefixed with "_", e.g.: p1=1&p2=2)    
shall the report be sent to the printer directly?

name of the printer (only when p_print_is_enabled=true)

media used, either the paper size or the tray (only when p_print_is_enabled=true)

number of copies to be printed (only when p_print_is_enabled=true)

duplex printing? (only when p_print_is_enabled=true)

sorting the print output? (only when p_print_is_enabled=true)

shall the generated file be saved on the application server, too?

fully specified path to the filename where the output should be saved on the server (only when p_save_is_enabled=true)

"time zone" parameter for the execution of the report,
a list of valid entries can be found here:
e.g.: Europe/Berlin, UCT, US/Central, US/Pacific, Etc/Greenwich, Europe/London

Deployment of reports

The report files will have to be stored on the application server. Copy the compiled version (report.jasper) of your report definition file (test.jrxml) into the directory OC_JASPER_CONFIG_HOME/reports/.

You can also create subdirectories to organize your reports. For example if you have different reports in your application application1 for sales and for controlling:

  1. reports/test.jasper
  2. reports/application1/sales/sales-report.jasper
  3. reports/application1/controlling/controlling-report.jasper
You would use as a p_rep_name the following values:
  1. p_rep_name => 'test'
  2. p_rep_name => 'application1/sales/sales-report'
  3. p_rep_name => 'application1/controlling/controlling-report'

Input parameter for the reports

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.

Configuration of export properties 

You can control the behaviour when exporting the report into the different report formats like pdf, html, rtf, xls, jxl, csv, xlsx, pptx or docx. 

You can find the configuration reference at:

There are two ways how to set export properties.

1. Global export configuration properties
JasperReports will load the "" from classpath.

In case you are using Tomcat, the properties file can be placed in this
directory (it will be initially installed here anyway):
# You can find all possible configuration parameters here:

# general export properties

# docx export properties

# xls export properties (also for xlsx)

# csv export properties

# html export properties


2. Individual export configuration properties per report
Properties can also be set in the jrxml file for each individual report. Therefore it is possible to use
different sets of properties for one JasperReportsIntegretion instance, because
all necessary properties are set in the compiled jasper file.

<jasperReport xmlns=""
    isSummaryNewPage="true" isIgnorePagination="true">
    <property name=""

You can find the configuration settings in iReport in the properties view of the report (root node)

Individual report settings will always override global settings.