ApEx report printing with XSL-FO
633630May 6 2009 — edited May 6 2009Hello all,
I'm currently running ApEx 3.1.2 with XE on my local machine trying to set up report printing for PDF following this guide:
[http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html#05]
All the setup is fine, except for a minor inconvenience that I have to start up XE before running OC4J due to the XE TNSListener won't be starting up if the ORACLE_HOME environment variable for OC4J is set before starting up XE; but anyhow, starting XE, setting ORACLE_HOME, then starting OC4J will give me a working ApEx and Apache FOP.
The problem I encountered is that when I am printing a report query using the "Generic Report Layout", I get a working PDF with just a table with entries; However, when I try to use my own XSL-FO stylesheet (saved in .xml format, encoded in UTF-8), I get a 304 bytes PDF file that Acrobat Reader claimed is corrupted. Upon opening this "corrupted" PDF file using Notepad I see the infamous:
<HTML>
<HEAD>
<TITLE>500 Internal Server Error</TITLE>
</HEAD>
<BODY><H1>500 Internal Server Error</H1>
<PRE>Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.</PRE>
</BODY>
</HTML>
After seeing this, I moved on to debug my XSL-FO stylesheet, thinking something must be wrong with it; but after frustrating attempts of trying to find a bug, I came across with Marc's article:
[http://marcsewtz.blogspot.com/2008/06/heres-another-posting-on-pdf-printing.html]
that talked about testing the FOP outside of APEX. My XSL stylesheet was proven alright as using it along with the corresponding XML dataset worked fine (and got a working PDF) with Marc's HTML test page.
Out of curiousity I created a Report Query (under Shared Components) mimicking Marc's XML dataset (by returning columns "FIRST_NAME" and "LAST_NAME"), and loaded that XSL-FO stylesheet provided on Marc's article for Report Layout. When I pressed the "Test Report" on the Confirm page, I got that 304 bytes "corrupted" PDF... However if I use the "Generic Report Layout", I got a working PDF.
So right now I'm stuck in this weird situation with no clue of what's going on, and would really appreciate any help or suggestions.
Thanks,
Nelson