Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX Interactive Report Download XML Generated but PDF not opening

InfantrajSep 14 2016 — edited Jul 8 2017

Hi All,

I'm Using Application Express 5.0.0.00.31 version with Print Server as Oracle APEX Listener (ORDS).

While downloading the report in PDF format, file is downloaded but its corrupted. I have checked inside the file it has the XML generated for the report downloaded. Please advise if I missed any configuration.

XML generated while downloading the report...

<?xml version="1.0" encoding="UTF-8"?>

<apexListnerFOP>

<DOCUMENT>

   <DATE>14-SEP-16</DATE>

   <USER_NAME>XXXXXXXXXX</USER_NAME>

   <APP_ID>153</APP_ID>

   <APP_NAME>PDF Printing in IR</APP_NAME>

   <PAGE_ID>3</PAGE_ID>

   <TITLE>Report 1</TITLE>

  <P3_REPORT_SEARCH></P3_REPORT_SEARCH>

  <P3_ROWS></P3_ROWS>

   <REGION ID="68883470361632202">

      <ROWSET>

         <ROW>

            <EMPNO>7369</EMPNO>

            <ENAME>SMITH</ENAME>

            <JOB>CLERK</JOB>

            <MGR>7902</MGR>

            <HIREDATE>17-DEC-80</HIREDATE>

            <SAL>800</SAL>

            <COMM></COMM>

            <DEPTNO>20</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7499</EMPNO>

            <ENAME>ALLEN</ENAME>

            <JOB>SALESMAN</JOB>

            <MGR>7698</MGR>

            <HIREDATE>20-FEB-81</HIREDATE>

            <SAL>1600</SAL>

            <COMM>300</COMM>

            <DEPTNO>30</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7521</EMPNO>

            <ENAME>WARD</ENAME>

            <JOB>SALESMAN</JOB>

            <MGR>7698</MGR>

            <HIREDATE>22-FEB-81</HIREDATE>

            <SAL>1250</SAL>

            <COMM>500</COMM>

            <DEPTNO>30</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7566</EMPNO>

            <ENAME>JONES</ENAME>

            <JOB>MANAGER</JOB>

            <MGR>7839</MGR>

            <HIREDATE>02-APR-81</HIREDATE>

            <SAL>2975</SAL>

            <COMM></COMM>

            <DEPTNO>20</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7654</EMPNO>

            <ENAME>MARTIN</ENAME>

            <JOB>SALESMAN</JOB>

            <MGR>7698</MGR>

            <HIREDATE>28-SEP-81</HIREDATE>

            <SAL>1250</SAL>

            <COMM>1400</COMM>

            <DEPTNO>30</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7698</EMPNO>

            <ENAME>BLAKE</ENAME>

            <JOB>MANAGER</JOB>

            <MGR>7839</MGR>

            <HIREDATE>01-MAY-81</HIREDATE>

            <SAL>2850</SAL>

            <COMM></COMM>

            <DEPTNO>30</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7782</EMPNO>

            <ENAME>CLARK</ENAME>

            <JOB>MANAGER</JOB>

            <MGR>7839</MGR>

            <HIREDATE>09-JUN-81</HIREDATE>

            <SAL>2450</SAL>

            <COMM></COMM>

            <DEPTNO>10</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7788</EMPNO>

            <ENAME>SCOTT</ENAME>

            <JOB>ANALYST</JOB>

            <MGR>7566</MGR>

            <HIREDATE>19-APR-87</HIREDATE>

            <SAL>3000</SAL>

            <COMM></COMM>

            <DEPTNO>20</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7839</EMPNO>

            <ENAME>KING</ENAME>

            <JOB>PRESIDENT</JOB>

            <MGR></MGR>

            <HIREDATE>17-NOV-81</HIREDATE>

            <SAL>5000</SAL>

            <COMM></COMM>

            <DEPTNO>10</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7844</EMPNO>

            <ENAME>TURNER</ENAME>

            <JOB>SALESMAN</JOB>

            <MGR>7698</MGR>

            <HIREDATE>08-SEP-81</HIREDATE>

            <SAL>1500</SAL>

            <COMM>0</COMM>

            <DEPTNO>30</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7876</EMPNO>

            <ENAME>ADAMS</ENAME>

            <JOB>CLERK</JOB>

            <MGR>7788</MGR>

            <HIREDATE>23-MAY-87</HIREDATE>

            <SAL>1100</SAL>

            <COMM></COMM>

            <DEPTNO>20</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7900</EMPNO>

            <ENAME>JAMES</ENAME>

            <JOB>CLERK</JOB>

            <MGR>7698</MGR>

            <HIREDATE>03-DEC-81</HIREDATE>

            <SAL>950</SAL>

            <COMM></COMM>

            <DEPTNO>30</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7902</EMPNO>

            <ENAME>FORD</ENAME>

            <JOB>ANALYST</JOB>

            <MGR>7566</MGR>

            <HIREDATE>03-DEC-81</HIREDATE>

            <SAL>3000</SAL>

            <COMM></COMM>

            <DEPTNO>20</DEPTNO>

         </ROW>

         <ROW>

            <EMPNO>7934</EMPNO>

            <ENAME>MILLER</ENAME>

            <JOB>CLERK</JOB>

            <MGR>7782</MGR>

            <HIREDATE>23-JAN-82</HIREDATE>

            <SAL>1300</SAL>

            <COMM></COMM>

            <DEPTNO>10</DEPTNO>

         </ROW>

      </ROWSET>

   </REGION>

</DOCUMENT>

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink">

   <xsl:variable name="_XDOFOPOS" select="''"/>

   <xsl:variable name="_XDOFOPOS2" select="number(1)"/>

   <xsl:variable name="_XDOFOTOTAL" select="number(1)"/>

   <xsl:variable name="_XDOFOOSTOTAL" select="number(0)"/>

   <xsl:attribute-set name="padding">

      <xsl:attribute name="padding-bottom">0.25pt</xsl:attribute>

      <xsl:attribute name="padding-top">0.25pt</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="text">

      <xsl:attribute name="text-align">start</xsl:attribute>

      <xsl:attribute name="orphans">2</xsl:attribute>

      <xsl:attribute name="start-indent">0.0pt</xsl:attribute>

      <xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>

      <xsl:attribute name="padding-top">0.0pt</xsl:attribute>

      <xsl:attribute name="end-indent">0.0pt</xsl:attribute>

      <xsl:attribute name="padding-bottom">0.0pt</xsl:attribute>

      <xsl:attribute name="height">0.0pt</xsl:attribute>

      <xsl:attribute name="widows">2</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="align-left">

      <xsl:attribute name="text-align">left</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="align-center">

      <xsl:attribute name="text-align">center</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="align-right">

      <xsl:attribute name="text-align">right</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="footer">

      <xsl:attribute name="text-align">right</xsl:attribute>

      <xsl:attribute name="start-indent">5.4pt</xsl:attribute>

      <xsl:attribute name="end-indent">5.4pt</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="text_2">

      <xsl:attribute name="start-indent">5.4pt</xsl:attribute>

      <xsl:attribute name="end-indent">23.4pt</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="text_20">

      <xsl:attribute name="height">13.872pt</xsl:attribute>

      <xsl:attribute name="end-indent">5.4pt</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="text_0">

      <xsl:attribute name="end-indent">5.4pt</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="page-header">

      <xsl:attribute name="color">#000000</xsl:attribute>

      <xsl:attribute name="font-family">Helvetica</xsl:attribute>

      <xsl:attribute name="white-space-collapse">false</xsl:attribute>

      <xsl:attribute name="font-size">12pt</xsl:attribute>

      <xsl:attribute name="font-weight">normal</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="page-footer">

      <xsl:attribute name="color">#000000</xsl:attribute>

      <xsl:attribute name="font-family">Helvetica</xsl:attribute>

      <xsl:attribute name="white-space-collapse">false</xsl:attribute>

      <xsl:attribute name="font-size">12pt</xsl:attribute>

      <xsl:attribute name="font-weight">normal</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="body-font">

      <xsl:attribute name="height">12.0pt</xsl:attribute>

      <xsl:attribute name="font-family">Helvetica</xsl:attribute>

      <xsl:attribute name="white-space-collapse">false</xsl:attribute>

      <xsl:attribute name="font-size">9pt</xsl:attribute>

      <xsl:attribute name="font-weight">normal</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="page-number">

      <xsl:attribute name="height">13.872pt</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="header-font">

      <xsl:attribute name="height">9pt</xsl:attribute>

      <xsl:attribute name="font-family">Helvetica</xsl:attribute>

      <xsl:attribute name="white-space-collapse">false</xsl:attribute>

      <xsl:attribute name="font-size">9pt</xsl:attribute>

      <xsl:attribute name="font-weight">bold</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="border">

      <xsl:attribute name="border-top">      1.00pt solid #000000</xsl:attribute>

      <xsl:attribute name="border-bottom">      1.00pt solid #000000</xsl:attribute>

      <xsl:attribute name="border-start-width">      1.00pt</xsl:attribute>

      <xsl:attribute name="border-start-color">#000000</xsl:attribute>

      <xsl:attribute name="border-start-style">solid</xsl:attribute>

      <xsl:attribute name="border-end-width">      1.00pt</xsl:attribute>

      <xsl:attribute name="border-end-color">#000000</xsl:attribute>

      <xsl:attribute name="border-end-style">solid</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="cell">

      <xsl:attribute name="background-color">#efefef</xsl:attribute>

      <xsl:attribute name="color">#000000</xsl:attribute>

      <xsl:attribute name="padding-start">5.15pt</xsl:attribute>

      <xsl:attribute name="vertical-align">top</xsl:attribute>

      <xsl:attribute name="padding-top">0.0pt</xsl:attribute>

      <xsl:attribute name="padding-end">5.15pt</xsl:attribute>

      <xsl:attribute name="number-columns-spanned">1</xsl:attribute>

      <xsl:attribute name="height">0.0pt</xsl:attribute>

      <xsl:attribute name="padding-bottom">0.0pt</xsl:attribute>

   </xsl:attribute-set>

   <xsl:attribute-set name="header-color">

      <xsl:attribute name="background-color">#9bafde</xsl:attribute>

      <xsl:attribute name="color">#ffffff</xsl:attribute>

   </xsl:attribute-set>

   <xsl:template match="/">

      <fo:root>

         <fo:layout-master-set>

            <fo:simple-page-master master-name="master0" margin-left="66.6pt" margin-right="66.6pt" page-height="    612.00pt" page-width="    792.00pt" margin-top="36.0pt" margin-bottom="36.0pt">

               <fo:region-body region-name="region-body" margin-top="54.0pt" margin-bottom="54.0pt"/>

               <fo:region-before region-name="region-header" extent="54.0pt"/>

               <fo:region-after region-name="region-footer" extent="54.0pt" display-align="after"/>

            </fo:simple-page-master>

         </fo:layout-master-set>

         <fo:page-sequence master-reference="master0">

            <xsl:variable name="_PW" select="number(    612.00)"/>

            <xsl:variable name="_PH" select="number(    792.00)"/>

            <xsl:variable name="_ML" select="number(72.0)"/>

            <xsl:variable name="_MR" select="number(72.0)"/>

            <xsl:variable name="_MT" select="number(90.0)"/>

            <xsl:variable name="_MB" select="number(90.0)"/>

            <xsl:variable name="_HY" select="number(36.0)"/>

            <xsl:variable name="_FY" select="number(36.0)"/>

            <xsl:variable name="_SECTION_NAME" select="string('master0')"/>

            <fo:static-content flow-name="region-header">

               <fo:block xsl:use-attribute-sets="text text_2 text_0 align-center">

                  <fo:inline xsl:use-attribute-sets="page-header"></fo:inline>

               </fo:block>

            </fo:static-content>

            <fo:static-content flow-name="region-footer">

               <fo:block xsl:use-attribute-sets="text footer">

                  <fo:inline xsl:use-attribute-sets="body-font page-number">

                     <fo:page-number/>

                  </fo:inline>

               </fo:block>

               <fo:block xsl:use-attribute-sets="text text_2 align-center">

                  <fo:inline xsl:use-attribute-sets="page-footer"></fo:inline>

               </fo:block>

            </fo:static-content>

            <fo:flow flow-name="region-body">

               <fo:block xsl:use-attribute-sets="padding">

                  <fo:table start-indent="0.0pt">

                     <xsl:variable name="_XDOFOPOS2" select="number(1)"/>

                     <xsl:variable name="_XDOFOTOTAL" select="number(1)"/>

                     <fo:table-column column-width="80pt"/>

                     <fo:table-column column-width="80pt"/>

                     <fo:table-column column-width="80pt"/>

                     <fo:table-column column-width="80pt"/>

                     <fo:table-column column-width="80pt"/>

                     <fo:table-column column-width="80pt"/>

                     <fo:table-column column-width="80pt"/>

                     <fo:table-column column-width="80pt"/>

                     <fo:table-header>

                        <fo:table-row>

                           <fo:table-cell xsl:use-attribute-sets="cell header-color border">

                               <fo:block xsl:use-attribute-sets="text align-left">

                                   <fo:inline xsl:use-attribute-sets="header-font">Empno</fo:inline>

                               </fo:block>

                           </fo:table-cell>

                           <fo:table-cell xsl:use-attribute-sets="cell header-color border">

                               <fo:block xsl:use-attribute-sets="text align-left">

                                   <fo:inline xsl:use-attribute-sets="header-font">Ename</fo:inline>

                               </fo:block>

                           </fo:table-cell>

                           <fo:table-cell xsl:use-attribute-sets="cell header-color border">

                               <fo:block xsl:use-attribute-sets="text align-left">

                                   <fo:inline xsl:use-attribute-sets="header-font">Job</fo:inline>

                               </fo:block>

                           </fo:table-cell>

                           <fo:table-cell xsl:use-attribute-sets="cell header-color border">

                               <fo:block xsl:use-attribute-sets="text align-left">

                                   <fo:inline xsl:use-attribute-sets="header-font">Mgr</fo:inline>

                               </fo:block>

                           </fo:table-cell>

                           <fo:table-cell xsl:use-attribute-sets="cell header-color border">

                               <fo:block xsl:use-attribute-sets="text align-left">

                                   <fo:inline xsl:use-attribute-sets="header-font">Hiredate</fo:inline>

                               </fo:block>

                           </fo:table-cell>

                           <fo:table-cell xsl:use-attribute-sets="cell header-color border">

                               <fo:block xsl:use-attribute-sets="text align-left">

                                   <fo:inline xsl:use-attribute-sets="header-font">Sal</fo:inline>

                               </fo:block>

                           </fo:table-cell>

                           <fo:table-cell xsl:use-attribute-sets="cell header-color border">

                               <fo:block xsl:use-attribute-sets="text align-left">

                                   <fo:inline xsl:use-attribute-sets="header-font">Comm</fo:inline>

                               </fo:block>

                           </fo:table-cell>

                           <fo:table-cell xsl:use-attribute-sets="cell header-color border">

                               <fo:block xsl:use-attribute-sets="text align-left">

                                   <fo:inline xsl:use-attribute-sets="header-font">Deptno</fo:inline>

                               </fo:block>

                           </fo:table-cell>

                        </fo:table-row>

                     </fo:table-header>

                     <fo:table-body>

                        <xsl:for-each select=".//ROW">

                           <fo:table-row>

                              <fo:table-cell xsl:use-attribute-sets="cell border">

                                  <fo:block xsl:use-attribute-sets="text align-left">

                                      <fo:inline xsl:use-attribute-sets="body-font">

                                          <xsl:value-of select=".//EMPNO"/>

                                      </fo:inline>

                                  </fo:block>

                              </fo:table-cell>

                              <fo:table-cell xsl:use-attribute-sets="cell border">

                                  <fo:block xsl:use-attribute-sets="text align-left">

                                      <fo:inline xsl:use-attribute-sets="body-font">

                                          <xsl:value-of select=".//ENAME"/>

                                      </fo:inline>

                                  </fo:block>

                              </fo:table-cell>

                              <fo:table-cell xsl:use-attribute-sets="cell border">

                                  <fo:block xsl:use-attribute-sets="text align-left">

                                      <fo:inline xsl:use-attribute-sets="body-font">

                                          <xsl:value-of select=".//JOB"/>

                                      </fo:inline>

                                  </fo:block>

                              </fo:table-cell>

                              <fo:table-cell xsl:use-attribute-sets="cell border">

                                  <fo:block xsl:use-attribute-sets="text align-left">

                                      <fo:inline xsl:use-attribute-sets="body-font">

                                          <xsl:value-of select=".//MGR"/>

                                      </fo:inline>

                                  </fo:block>

                              </fo:table-cell>

                              <fo:table-cell xsl:use-attribute-sets="cell border">

                                  <fo:block xsl:use-attribute-sets="text align-left">

                                      <fo:inline xsl:use-attribute-sets="body-font">

                                          <xsl:value-of select=".//HIREDATE"/>

                                      </fo:inline>

                                  </fo:block>

                              </fo:table-cell>

                              <fo:table-cell xsl:use-attribute-sets="cell border">

                                  <fo:block xsl:use-attribute-sets="text align-left">

                                      <fo:inline xsl:use-attribute-sets="body-font">

                                          <xsl:value-of select=".//SAL"/>

                                      </fo:inline>

                                  </fo:block>

                              </fo:table-cell>

                              <fo:table-cell xsl:use-attribute-sets="cell border">

                                  <fo:block xsl:use-attribute-sets="text align-left">

                                      <fo:inline xsl:use-attribute-sets="body-font">

                                          <xsl:value-of select=".//COMM"/>

                                      </fo:inline>

                                  </fo:block>

                              </fo:table-cell>

                              <fo:table-cell xsl:use-attribute-sets="cell border">

                                  <fo:block xsl:use-attribute-sets="text align-left">

                                      <fo:inline xsl:use-attribute-sets="body-font">

                                          <xsl:value-of select=".//DEPTNO"/>

                                      </fo:inline>

                                  </fo:block>

                              </fo:table-cell>

                           </fo:table-row>

                        </xsl:for-each>

                     </fo:table-body>

                  </fo:table>

               </fo:block>

               <fo:block xsl:use-attribute-sets="text text_2 text_20">

                  <fo:inline id="{concat('page-total-', $_SECTION_NAME, $_XDOFOPOS)}"/>

                  <fo:inline id="{concat('page-total', $_XDOFOPOS)}"/>

               </fo:block>

            </fo:flow>

         </fo:page-sequence>

      </fo:root>

   </xsl:template>

</xsl:stylesheet>

</apexListnerFOP>

Thanks

Infant Raj

This post has been answered by Mike Kutz on Sep 14 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2016
Added on Sep 14 2016
9 comments
1,151 views