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 (10.1.3.2 or above) [I don't have a clue what this is]. My DBA advised me that our version of Oracle Containers for J2EE was 10.1.2.3 (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

                Oracle Apex - Position IR Control Panel items in one line

                This mini tip is to help those who does not know CSS much and those who know CSS but do not know where to apply code in Oracle Apex.

                In Interactive reports by default the control panel items (filters/report titles) etc will be displayed one line below the other. If you have ten filters applied on an IR/Interactive Report then the panel when expanded occupies 10 lines in the report just like the one below:


                This mini tip will enable you to change this like the one below:

                If you have a Page 0/Global Page created within your application do not follow step 1.

                Step 1: Create a Global Page/Page 0 in your application.
                Step 2: Create a HTML region with template "No template" in this page.
                Step 3: Add the following CSS inside this region source and save.

                <style>
                  table#apexir_CONTROL_PANEL_COMPLETE tr{float:left;padding-right:15px;}
                </style>

                This is all you have to do to change Interactive report's control panels visibility option in your entire application. The magic is not done by the little piece of code you have added now, but the way in which Global Page/Page 0 acts within an application.

                All piece of code inside this special page will be executed whenever a page within the application is invoked. Kudos to the Oracle Apex designers who have made this available to us.

                The second part of magic is the little piece of code you have added. Inside Oracle Apex, you can have only 1 interactive report in a page. All these reports control panels will be created with a table with id apexir_CONTROL_PANEL_COMPLETE. By specifying that rows are displayed in a single line you are utilizing the space available to the users.