PDF Download not working in Interactive Report : Oracle APEX: SOLVED Finally

This was one of my biggest concerns while using Oracle APEX. I will often enable PDF download from Interactive Report setup in a page, but the download was generating only a corrupt file. My google searches also did not yield any result.

Then came the news that I have to install BI Publisher in order to use the feature. This message was floating in OTN forums related to this topic. I got disheartened learning this.

Why would Oracle provide such a tool if it can't support PDF download by default.

Then came the SOLUTION for the problem. In one of documentation available in Oracle's website I found the news I have been searching for a long time.

The APEX download (4.2.2) had been shipped with a war file fop.war. This file is available in the folder apex_4.2.2\apex\utilities\fop

The installation instructions mentioned that I need to deploy this war file in OC4J but which requires  Oracle Containers for J2EE ( or above) [I don't have a clue what this is]. My DBA advised me that our version of Oracle Containers for J2EE was (oh not again).

I forced my DBA to deploy this war file in our development environment, and I had to do a simple settings in Admin Console of Oracle Apex. Voila the PDF download is now working.

I am summarizing the steps for noble souls who is faced with this situation:
  1. Deploy fop.war in your Apache/Application Server environment using your EM Console.
      • Login to EM console
        • Click on Home tab and navigate to Applications tab
          • Click on Deploy War file tab
            • Click Browse button and provide the path for fop.war file
                • For Application Name pass value  “fop”
                  • For Map to URL pass value “/fop”
                    • Click on Deploy button.
                1. Login to Apex Admin Console
                2. Navigate to Manage Instance, Instance Settings.
                3. Click Report Printing
                4. Specify the following:
                  1. Report Server: Oracle BI Publisher
                  2. Print Server Protocol: HTTP/HTTPS (based on your setup)
                  3. Print Server Host Address: Ip address of your application server
                  4. Print Server Port: Port of Application server (forms) -DO NOT USE APEX's PORT if this is different from Oracle Forms/Reports if installed.
                  5. Print Server Script: /fop/apex_fop.jsp

                More information can be found in this document which saved my situation.

                Reference: PDF Printing in Application Express using FOP