9 Replies Latest reply on Jul 19, 2011 8:28 AM by user12022803

    XML Publisher report error

    Jegan
      Hi,

      I took the report output as XML format. With the XML output i created a procedure and wrote the code.

      After executing the procedure i run the report.

      In concurrent i give the report output format as PCL.

      The report is in Completed phase.

      When i click view output i want the output in excel sheet. But i am getting an error like Problem in Worksheet Setting.

      CREATE OR REPLACE PROCEDURE APPS.xx_excel_report (
      errcode OUT VARCHAR2,
      errbuff OUT VARCHAR2
      )
      AS
      x NUMBER;

      CURSOR headers
      IS
      SELECT ooha.header_id, ooha.order_number, ooha.ordered_date
      FROM oe_order_headers_all ooha
      WHERE 1=1
      --and ooha.org_id = 204
      and rownum < 50;
      -- AND ooha.order_number = 3501;

      CURSOR lines (p_header_id NUMBER)
      IS
      SELECT line_number, inventory_item_id
      FROM oe_order_lines_all
      WHERE 1=1
      --and org_id = 204
      AND header_id = p_header_id;--26269;
      BEGIN

      fnd_file.put_line (fnd_file.output, '<?xml version="1.0"?>');
      fnd_file.put_line (fnd_file.output, '<?mso-application progid="Excel.Sheet"?>');
      fnd_file.put_line (fnd_file.output, '<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"');
      fnd_file.put_line (fnd_file.output, ' xmlns:o="urn:schemas-microsoft-com:office:office"');
      fnd_file.put_line (fnd_file.output, ' xmlns:x="urn:schemas-microsoft-com:office:excel"');
      fnd_file.put_line (fnd_file.output, ' xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"');
      fnd_file.put_line (fnd_file.output, ' xmlns:html="http://www.w3.org/TR/REC-html40">');
      fnd_file.put_line (fnd_file.output, ' <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">');
      fnd_file.put_line (fnd_file.output, ' <Author>Chain-Sys</Author>');
      fnd_file.put_line (fnd_file.output, ' <LastAuthor>Chain-Sys</LastAuthor>');
      fnd_file.put_line (fnd_file.output, ' <Created>2009-08-18T05:48:24Z</Created>');
      fnd_file.put_line (fnd_file.output, ' <Company>Lenovo</Company>');
      fnd_file.put_line (fnd_file.output, ' <Version>12.00</Version>');
      fnd_file.put_line (fnd_file.output, ' </DocumentProperties>');
      fnd_file.put_line (fnd_file.output, ' <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">');
      fnd_file.put_line (fnd_file.output, ' <WindowHeight>8415</WindowHeight>');
      fnd_file.put_line (fnd_file.output, ' <WindowWidth>19095</WindowWidth>');
      fnd_file.put_line (fnd_file.output, ' <WindowTopX>120</WindowTopX>');
      fnd_file.put_line (fnd_file.output, ' <WindowTopY>150</WindowTopY>');
      fnd_file.put_line (fnd_file.output, ' <ProtectStructure>False</ProtectStructure>');
      fnd_file.put_line (fnd_file.output, ' <ProtectWindows>False</ProtectWindows>');
      fnd_file.put_line (fnd_file.output, ' </ExcelWorkbook>');
      fnd_file.put_line (fnd_file.output, ' <Styles>');
      fnd_file.put_line (fnd_file.output, ' <Style ss:ID="Default" ss:Name="Normal">');
      fnd_file.put_line (fnd_file.output, ' <Alignment ss:Vertical="Bottom"/>');
      fnd_file.put_line (fnd_file.output, ' <Borders/>');
      fnd_file.put_line (fnd_file.output, ' <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>');
      fnd_file.put_line (fnd_file.output, ' <Interior/>');
      fnd_file.put_line (fnd_file.output, ' <NumberFormat/>');
      fnd_file.put_line (fnd_file.output, ' <Protection/>');
      fnd_file.put_line (fnd_file.output, ' </Style>');
      fnd_file.put_line (fnd_file.output, ' <Style ss:ID="s62">');
      fnd_file.put_line (fnd_file.output, ' <NumberFormat ss:Format="Medium Date"/>');
      fnd_file.put_line (fnd_file.output, ' </Style>');
      fnd_file.put_line (fnd_file.output, ' </Styles>');
      fnd_file.put_line (fnd_file.output, ' <Worksheet ss:Name="Sheet1">');
      fnd_file.put_line (fnd_file.output, ' <Table ss:ExpandedColumnCount="6" ss:ExpandedRowCount="2" x:FullColumns="1"');
      fnd_file.put_line (fnd_file.output, ' x:FullRows="1" ss:DefaultRowHeight="15">');
      fnd_file.put_line (fnd_file.output, ' <Column ss:AutoFitWidth="0" ss:Width="71.25"/>');
      fnd_file.put_line (fnd_file.output, ' <Column ss:Width="51.75"/>');
      fnd_file.put_line (fnd_file.output, ' <Column ss:Index="4" ss:AutoFitWidth="0" ss:Width="60.75"/>');
      fnd_file.put_line (fnd_file.output, ' <Row ss:AutoFitHeight="0">');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">Order Number</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">Date</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">type</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">customerPO</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">shipto</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">billto</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' </Row>');
      FOR cur_headers IN headers
      LOOP
      fnd_file.put_line (fnd_file.output, ' <Row ss:AutoFitHeight="0">');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="Number">1213</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell ss:StyleID="s62"><Data ss:Type="DateTime">2009-08-12T00:00:00.000</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">8756437</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">xyz879</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="Number">1234</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="Number">3321</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' </Row>');

      fnd_file.put_line (fnd_file.output, ' <Row ss:AutoFitHeight="0">');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="Number">12</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell ss:StyleID="s62"><Data ss:Type="DateTime">2009-08-12T00:00:00.000</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">875</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="String">x79</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="Number">134</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' <Cell><Data ss:Type="Number">321</Data></Cell>');
      fnd_file.put_line (fnd_file.output, ' </Row>');
      end loop;
      fnd_file.put_line (fnd_file.output, ' </Table>');
      fnd_file.put_line (fnd_file.output, ' <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">');
      fnd_file.put_line (fnd_file.output, ' <PageSetup>');
      fnd_file.put_line (fnd_file.output, ' <Header x:Margin="0.3"/>');
      fnd_file.put_line (fnd_file.output, ' <Footer x:Margin="0.3"/>');
      fnd_file.put_line (fnd_file.output, ' <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>');
      fnd_file.put_line (fnd_file.output, ' </PageSetup>');
      fnd_file.put_line (fnd_file.output, ' <Unsynced/>');
      fnd_file.put_line (fnd_file.output, ' <Selected/>');
      fnd_file.put_line (fnd_file.output, ' <Panes>');
      fnd_file.put_line (fnd_file.output, ' <Pane>');
      fnd_file.put_line (fnd_file.output, ' <Number>3</Number>');
      fnd_file.put_line (fnd_file.output, ' <RangeSelection>R1C1:R2C6</RangeSelection>');
      fnd_file.put_line (fnd_file.output, ' </Pane>');
      fnd_file.put_line (fnd_file.output, ' </Panes>');
      fnd_file.put_line (fnd_file.output, ' <ProtectObjects>False</ProtectObjects>');
      fnd_file.put_line (fnd_file.output, ' <ProtectScenarios>False</ProtectScenarios>');
      fnd_file.put_line (fnd_file.output, ' </WorksheetOptions>');
      fnd_file.put_line (fnd_file.output, ' </Worksheet>');
      fnd_file.put_line (fnd_file.output, ' <Worksheet ss:Name="Sheet2">');
      fnd_file.put_line (fnd_file.output, ' <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"');
      fnd_file.put_line (fnd_file.output, ' x:FullRows="1" ss:DefaultRowHeight="15">');
      fnd_file.put_line (fnd_file.output, ' <Row ss:AutoFitHeight="0"/>');
      fnd_file.put_line (fnd_file.output, ' </Table>');
      fnd_file.put_line (fnd_file.output, ' <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">');
      fnd_file.put_line (fnd_file.output, ' <PageSetup>');
      fnd_file.put_line (fnd_file.output, ' <Header x:Margin="0.3"/>');
      fnd_file.put_line (fnd_file.output, ' <Footer x:Margin="0.3"/>');
      fnd_file.put_line (fnd_file.output, ' <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>');
      fnd_file.put_line (fnd_file.output, ' </PageSetup>');
      fnd_file.put_line (fnd_file.output, ' <Unsynced/>');
      fnd_file.put_line (fnd_file.output, ' <ProtectObjects>False</ProtectObjects>');
      fnd_file.put_line (fnd_file.output, ' <ProtectScenarios>False</ProtectScenarios>');
      fnd_file.put_line (fnd_file.output, ' </WorksheetOptions>');
      fnd_file.put_line (fnd_file.output, ' </Worksheet>');
      fnd_file.put_line (fnd_file.output, ' <Worksheet ss:Name="Sheet3">');
      fnd_file.put_line (fnd_file.output, ' <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"');
      fnd_file.put_line (fnd_file.output, ' x:FullRows="1" ss:DefaultRowHeight="15">');
      fnd_file.put_line (fnd_file.output, ' <Row ss:AutoFitHeight="0"/>');
      fnd_file.put_line (fnd_file.output, ' </Table>');
      fnd_file.put_line (fnd_file.output, ' <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">');
      fnd_file.put_line (fnd_file.output, ' <PageSetup>');
      fnd_file.put_line (fnd_file.output, ' <Header x:Margin="0.3"/>');
      fnd_file.put_line (fnd_file.output, ' <Footer x:Margin="0.3"/>');
      fnd_file.put_line (fnd_file.output, ' <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>');
      fnd_file.put_line (fnd_file.output, ' </PageSetup>');
      fnd_file.put_line (fnd_file.output, ' <Unsynced/>');
      fnd_file.put_line (fnd_file.output, ' <ProtectObjects>False</ProtectObjects>');
      fnd_file.put_line (fnd_file.output, ' <ProtectScenarios>False</ProtectScenarios>');
      fnd_file.put_line (fnd_file.output, ' </WorksheetOptions>');
      fnd_file.put_line (fnd_file.output, ' </Worksheet>');
      fnd_file.put_line (fnd_file.output, '</Workbook>');
      END;
      /