Developer Tools
Application Express
application-express
Oracle Application Express |
Return to Oracle APEX Home | |||||||||||||
| PDF Printing in Application Express |
||||||||||||||
|
||||||||||||||
| 1. Introduction and Architecture |
||||||||||||||
Application Express PDF Printing Architecture |
||||||||||||||
|
When the end user of the application clicks on a print link, the request is sent to the Application Express engine (which is part of the Oracle database). The Oracle APEX engine then generates the corresponding report data in XML format and the report template in XSL-FO or RTF format. The external reporting engine then transforms the data and the template into a PDF which is displayed to the end user using the convert servlet that ships with BI Publisher 10.1.3.2 (formerly known as Oracle XML Publisher). All of this architectural complexity is transparent to the end users and developers. End users just click on print links, and developers just declaratively set regions to support PDF printing.
|
||||||||||||||
| 2. Configuration Options |
||||||||||||||
| 2.1 Standard
Standard configuration may be implemented with Apache FOP or another standard XSL-FO processing engine. Beginning with Application Express 3.0.1, a supported configuration of Apache FOP in conjunction with Oracle Containers for J2EE (10.1.3.2 or above) is included. This provides declarative formatting of report regions and report queries with basic control over page attributes. These attributes include orientation, size, column heading formats, page header, and page footer. The following screen shots illustrate standard configuration:
Advanced configuration requires a valid license for Oracle BI Publisher. With advanced configuration, you have all the capabilities of standard configuration plus the ability to define RTF-based report layouts developed using the BI Publisher Word Template Plug-In. This provides easy graphical control over every aspect of your report. You can add logos to your pages, add complex control breaks, and have full pagination control. You can even embed charts and create reports that look exactly like standard government forms. The following screen shots illustrate advanced configuration:
There is also a How-To for Advanced PDF Reporting: How-To Create a Master-Detail PDF Report. 2.3 Advantages of using BI Publisher within Application Express Using BI Publisher as your Application Express print server results in more robust and professional applications.
|
||||||||||||||
| 3. Installing and Configuring Oracle BI Publisher on Windows |
||||||||||||||
| 3.1 Prerequisites
To use Oracle BI Publisher as your report server, you need to install Oracle Business Intelligence Publisher, v. 10.1.3.2.1 or above. This can be downloaded at the link below under the OTN Developer License (... limited license to use the programs only for the purpose of developing a single prototype of your application, and not for any other purpose ...). Oracle Business Intelligence Publisher Downloads, select the latest version of BI Publisher. You can also download the Desktop software at the same time. This will allow you to create RTF templates to use in your reports. More information about Oracle BI Publisher can be found on their OTN site. Please note: 2) If you are experiencing the following error when trying to load an XML sample file when building a template, "Compile error in hidden module: Module_starter", it was caused by a Windows security patch. The workaround is:
3.3 Configuring Application Express to use BI Publisher To use BI Publisher as your Report Server, first, access the Report Printing parameters:
|
||||||||||||||
| 4. Installing and Configuring Oracle BI Publisher on Linux |
||||||||||||||
| 4.1 Prerequisites
To use Oracle BI Publisher as your report server, you need to install Oracle Business Intelligence Publisher, v. 10.1.3.2.1 or above. This can be downloaded at the link below under the OTN Developer License (... limited license to use the programs only for the purpose of developing a single prototype of your application, and not for any other purpose ...). Oracle Business Intelligence Publisher Downloads, select the latest version of BI Publisher. You can also download the Desktop software at the same time. This will allow you to create RTF templates to use in your reports. More information about Oracle BI Publisher can be found on their OTN site. Before installing Oracle BI Publisher, ensure that you have Java SDK 1.5.0 installed on your system. The Java SDK can be downloaded here: http://java.sun.com/javase/downloads/index_jdk5.jsp Note: The Sun release name was originally Java 2 Platform, Standard Edition 1.5.0 (J2SE Development Kit 1.5.0). The numbering system changed to 5.0 (J2SE 5.0). Both 1.5.0 and 5.0 refer to the same platform and product. Based on the version of BI Publisher downloaded select the appropriate documentation from BI Publisher Documentation and follow the installation guide provided under Getting Started. After you complete the BI Publisher installation, you need to start OC4J. After starting OC4J, you should open the BI Publisher start page to verify that BI Publisher is up and running. If you are unsure what host address and port you need to use when configuring this in Application Express, please reference the host address and port shown in your browser's URL field after opening the BI Publisher start page. 4.3 Configuring Application Express to use BI Publisher To use BI Publisher as your Report Server, first, access the Report Printing parameters:
|
||||||||||||||
| 5. Installing and Configuring Apache FOP |
||||||||||||||
| 5.1 Prerequisites
A supported configuration of Apache FOP in conjunction with Oracle Containers for J2EE (10.1.3.2 or above) is provided with Application Express 3.0.1. The Apache FOP installation is included in the Application Express distribution under apex_install_directory/utlities/fop/fop.war. Please note - Beginning with Application Express 3.0.1, Apache FOP in conjunction with Oracle Containers for J2EE (10.1.3.2 or above) is a supported report server but only when installed using the provided files. Alternate configurations of Apache FOP are not supported. Questions related to alternate configurations should be posted on the Application Express OTN Forum. Before getting started, you will need to have Oracle Containers for J2EE (OC4J) up and running. The following version of OC4J have been verified to work with the FOP solution outlined below.
Place the fop.war file (located in apex_install_directory/utlities/fop) in an accessible location on your local machine. You then follow the directions below or can view the process by running this viewlet.
Once you have the FOP installed, access the Report Printing parameters:
|
||||||||||||||
| 6. Configuring Other XSL-FO Processing Engines |
||||||||||||||
| If you prefer to use another XSL-FO Processing Engine, you will need to create an endpoint that provides similar functionality to the example JSP provided for the Apache FOP example above. Only Oracle BI Publisher and the above described installation of Apache FOP in conjunction with Oracle Containers for J2EE (10.1.3.2 or above) are supported report servers. Questions related to other XSL-FO Processing Engine should be posted on the Application Express OTN Forum. | ||||||||||||||
| 7. Enabling Network Services in Oracle Database 11g |
||||||||||||||
By default, the ability to interact with network services is disabled in Oracle Database 11g release 1 (11.1). Therefore, if running Oracle Application Express with Oracle Database 11g release 1 (11.1), use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to any host for the FLOWS_030100 database user. Failing to grant these privileges results in issues with PDF/report printing, specifically, you will get the following error message:
ORA-20001: The printing engine could not be reached because either the URL specified is incorrect or a proxy URL needs to be specified.Follow the steps mentioned in the Oracle Application Express Installation Guide, Enabling Network Services in Oracle Database 11g. Also refer to the troubleshooting section in case you receive an ORA-44416: Invalid ACL error after running the previous script. |
||||||||||||||