Friday, December 12, 2008

PDF Printing in Application Express (Apex)

PDF Printing in Application Express (Apex)



1.Download Oracle Containers for J2EE (10.1.3.4)
http://www.oracle.com/technology/software/products/ias/htdocs/utilsoft.html

2. Installing Oracle Containers for J2EE (10.1.3.4)
Unzip oc4j_extended_101340.zip

SET ORACLE_HOME=c:\oc4j_extended_101340
SET JAVA_HOME = (Download Jdk)

Start oc4j
cd bin
oc4j -start

C:\oc4j_extended_101340\bin>oc4j -start
Starting OC4J from C:\oc4j_extended_101340\j2ee\home ...
08/12/12 13:46:04 Set OC4J administrator's password (password text will not be displayed as it is entered)
Enter password:xxxxxx
Confirm password:xxxxxx
The password for OC4J administrator "oc4jadmin" has been set.
08/12/12 13:46:17 The OC4J administrator "oc4jadmin" account is activated.
08/12/12 13:46:26 Oracle Containers for J2EE 10g (10.1.3.4.0) initialized


Stop oc4j
oc4j -shutdown -port 23791 -password xxxxxx

3.Configure PDF Printing in Apache FOP
Deploy fop.war
Place the fop.war file (located in apex_install_directory/utlities/fop) in an accessible location on your local machine
Navigate to your OC4J Oracle Enterprise Manager Console eg: http://localhost:8888/em/

Select the Applications Tab
Select Deploy Button

On the "Deploy: Select Archive" page use the option "Archive is present on local host. Upload the archive to the server where Application Server Control is running." Use the file browse to select the fop.war file and click "Next" button

On the "Deploy: Application Attributes" page set the "Application Name" option to "fop" and clear the "Context Root " option and click "Next" Button

On the Deploy: Deployment Settings click the "Deploy" button





4.Configure Oracle Application Express to use the JSP for PDF printing

Once you have the FOP installed, access the Report Printing parameters:
Access the Administration Services home page
Select Manage Service
Select Instance Settings, under Manage Environment Settings
Click Report Printing to focus on just the Report Printing attributes

Now, specify the following attributes:
Oracle BI Publisher: Standard Support
Print Server Protocol: HTTP or HTTPS (depends on your configuration)
Print Server Host Address:192.168.0.22 (the hostname for the machine where the java container is running )
Print Server Port: 8888 (the port that the OC4J is listening on - e.g. 8888)
Print Server Script: /fop/apex_fop.jsp

No comments: