SlideShare uma empresa Scribd logo
1 de 6
PL/SQL using XML (Excel output).

Following are the prerequisites for setting output in excel using PL/SQL with
XML.

   1. Layout needs to be designed in Excel (XML Spread Sheet).
   Consider an example of a simple tabular report:




   Excel layout has 2 columns Part number & Description. Requirement is report
   should open in excel with data pertaining to 2 columns mentioned. Put
   dummy data on the excel sheet with appropriate fonts used. Once layout &
   dummy data is designed then save the excel spread sheet as .xml.
   E.g. save with test.xml.

   2. Define Executable & concurrent program for this excel o/p.Executable will
   be defined as a PL/SQL stored procedure. Please refer to screen shot below.
Define concurrent program of output format as HTML: Refer to screen shot
below.




Concurrent program type should be HTML.

3. Once the above step is defined there are profile set up required for excel o/p to
work.
Profile name:

       Viewer: Application for HTML

Need to set at Site Level: Select LOV's it should say either Excel/Browser.
If LOV doesn’t shows Excel then need to perform the following step

    Go to System administrator->Install->Viewer Options.

Search for File format HTML.if not present create a new one.
File Format: HTML
Mime Type: application/vnd.ms-excel
Description: Microsoft Excel
Allow Native Client coding checkbox: Checked.

    Once this is done you should be able to open reports on excel.

4. Need to create a package for generating code in excel.

PROMPT CREATING PACKAGE SPECIFICATION FOR xxc_test_pkg
CREATE OR REPLACE PACKAGE xxc_test_pkg AS

        --
        PROCEDURE main             (errbuf    OUT       VARCHAR2,
                                   retcode    OUT       NUMBER
                                   );
       --
END xxc_test_pkg;

    PROMPT CREATING PACKAGE BODY FOR xxc_test_pkg
    CREATE OR REPLACE PACKAGE BODY xxc_test_pkg AS


     PROCEDURE new_row
     IS
     BEGiN
       fnd_file.put_line(fnd_file.output,'<Row>')
       ;
     END
     ;
     PROCEDURE end_row
     IS
     BEgiN
       fnd_file.put_line(fnd_file.output,'</Row>')
       ;
     END
     ;

       FUNCTION print_header
       RETURN NUMBER
       IS
       lv_text varchar2(32767) :='<?xml version="1.0"?>
    <?mso-application progid="Excel.Sheet"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
    xmlns:html="http://www.w3.org/TR/REC-html40">
    <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
     <Author>fz155</Author>
<LastAuthor>fz155</LastAuthor>
<Created>2007-05-07T12:36:22Z</Created>
<Company>Cummins Inc</Company>
<Version>11.8122</Version>
</DocumentProperties>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>7956</WindowHeight>
<WindowWidth>14143</WindowWidth>
<WindowTopX>456</WindowTopX>
<WindowTopY>14</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
 <Alignment ss:Vertical="Bottom"/>
 <Borders/>
 <Font/>
 <Interior/>
 <NumberFormat/>
 <Protection/>
</Style>
<Style ss:ID="s21">
 <Borders>
  <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
  <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>
  <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>
 </Borders>
 <Font x:Family="Swiss" ss:Bold="1"/>
</Style>
<Style ss:ID="s22">
 <Borders>
  <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
  <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/>
  <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/>
 </Borders>
 <Font x:Family="Swiss" ss:Bold="1"/>
</Style>
<Style ss:ID="s23">
 <Alignment ss:Vertical="Bottom" ss:WrapText="1"/>
</Style>
</Styles>
<Worksheet ss:Name="Data">
<Table ss:ExpandedColumnCount="66000" ss:ExpandedRowCount="66000" x:FullColumns="1"
 x:FullRows="1" ss:DefaultColumnWidth="51.326732673267323"
 ss:DefaultRowHeight="12.831683168316831">
 <Column ss:Width="67.009900990099013"/>
 <Column ss:AutoFitWidth="0" ss:Width="325.78217821782175"/>
 <Row ss:AutoFitHeight="0" ss:Height="13.544554455445544"/>
 <Row ss:AutoFitHeight="0" ss:Height="13.544554455445544">
  <Cell ss:StyleID="s21"><Data ss:Type="String">Part Number</Data></Cell>
  <Cell ss:StyleID="s22"><Data ss:Type="String">Description</Data></Cell>
 </Row>
 <Row ss:AutoFitHeight="0">
  <Cell ss:StyleID="s23"><Data ss:Type="String">Test</Data></Cell>
  <Cell ss:StyleID="s23"><Data ss:Type="String">Testing data</Data></Cell>
</Row>
 <Row ss:AutoFitHeight="0">
 <Cell ss:StyleID="s23"><Data ss:Type="String">Test</Data></Cell>
 <Cell ss:StyleID="s23"><Data ss:Type="String">Tetsing data</Data></Cell>
 </Row> ';
    BEGIN
              FND_FILE.PUT_LINE(FND_FILE.OUTPUT,lv_text);
              RETURN (1);
    ---------
    EXCEPTION
    ---------
              WHEN OTHERS THEN
               FND_FILE.PUT_LINE(FND_FILE.OUTPUT,SQLERRM);
               RETURN (0);
   END print_header;

    PROCEDURE print_footer
    IS
    lv_text varchar2(32000) :=' </Table>
    <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
  <Unsynced/>
  <Print>
  <ValidPrinterInfo/>
  <HorizontalResolution>600</HorizontalResolution>
  <VerticalResolution>600</VerticalResolution>
  </Print>
  <Selected/>
  <Panes>
  <Pane>
   <Number>3</Number>
   <ActiveRow>19</ActiveRow>
   <ActiveCol>1</ActiveCol>
  </Pane>
  </Panes>
  <ProtectObjects>False</ProtectObjects>
  <ProtectScenarios>False</ProtectScenarios>
 </WorksheetOptions>
</Worksheet>
</Workbook>';
    BEGIN
  fnd_file.put_line(fnd_file.output,lv_text);
    END;
    --
    PROCEDURE main              (errbuf     OUT     VARCHAR2,
                                Retcode OUT         NUMBER
                                )
    IS
    CURSOR c_part
    IS
    SELECT            segment1,
                      description
    FROM mtl_system_items
    WHEREROWNUM<=20;
    r_part            c_part%ROWTYPE;
    BEGIN
             IF print_header > 0 THEN
NULL;
             END IF;
             OPEN c_part;
             LOOP
             FETCH c_part INTO r_part;
             EXIT WHEN (c_part%NOTFOUND);
                      new_row;
                      FND_FILE.put_line(fnd_file.output,'<Cell ss:StyleID="s23"><Data
ss:Type="String">'||r_part.segment1||'</Data></Cell>');
                      FND_FILE.put_line(fnd_file.output,'<Cell ss:StyleID="s23"><Data
ss:Type="String">'||r_part.description||'</Data></Cell>');
                      end_row;
             END LOOP;
             CLOSE c_part;
             print_footer;
    END main;
    --
END xxc_test_pkg;


5. Deploy the Above Concurrent program in request group & execute this package. View o/p when
clicked will ask for LOV’s Browser/Excel. Select Excel o/p will open in excel.

Mais conteúdo relacionado

Mais procurados

Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sql
Sushil Mishra
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
Reka
 
Sql server ___________session_16(views)
Sql server  ___________session_16(views)Sql server  ___________session_16(views)
Sql server ___________session_16(views)
Ehtisham Ali
 

Mais procurados (20)

Procedures/functions of rdbms
Procedures/functions of rdbmsProcedures/functions of rdbms
Procedures/functions of rdbms
 
Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sql
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
 
Oracle: Procedures
Oracle: ProceduresOracle: Procedures
Oracle: Procedures
 
Sql server ___________session_16(views)
Sql server  ___________session_16(views)Sql server  ___________session_16(views)
Sql server ___________session_16(views)
 
Oracle - Program with PL/SQL - Lession 06
Oracle - Program with PL/SQL - Lession 06Oracle - Program with PL/SQL - Lession 06
Oracle - Program with PL/SQL - Lession 06
 
Part36 parameter,form success
Part36 parameter,form successPart36 parameter,form success
Part36 parameter,form success
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Babitha2.mysql
Babitha2.mysqlBabitha2.mysql
Babitha2.mysql
 
PLSQL Tutorial
PLSQL TutorialPLSQL Tutorial
PLSQL Tutorial
 
Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03
 
Oracle - Program with PL/SQL - Lession 17
Oracle - Program with PL/SQL - Lession 17Oracle - Program with PL/SQL - Lession 17
Oracle - Program with PL/SQL - Lession 17
 
Apps1
Apps1Apps1
Apps1
 
SQL
SQLSQL
SQL
 
Basic cursors in oracle
Basic cursors in oracleBasic cursors in oracle
Basic cursors in oracle
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
 
Oracle: DDL
Oracle: DDLOracle: DDL
Oracle: DDL
 
Oracle - Program with PL/SQL - Lession 01
Oracle - Program with PL/SQL - Lession 01Oracle - Program with PL/SQL - Lession 01
Oracle - Program with PL/SQL - Lession 01
 
Oracle Baisc Tutorial
Oracle Baisc TutorialOracle Baisc Tutorial
Oracle Baisc Tutorial
 
Les13
Les13Les13
Les13
 

Semelhante a Pl sql using_xml

My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
Anas Mohammed
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2
rowensCap
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
InSync Conference
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
paulguerin
 
Advanced tips of dbms statas
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statas
Louis liu
 

Semelhante a Pl sql using_xml (20)

My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2
 
SQL/MX 3.6 Select for update feature
SQL/MX 3.6 Select for update featureSQL/MX 3.6 Select for update feature
SQL/MX 3.6 Select for update feature
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
Web based development
Web based developmentWeb based development
Web based development
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 
Lab manual asp.net
Lab manual asp.netLab manual asp.net
Lab manual asp.net
 
Sql injection
Sql injectionSql injection
Sql injection
 
Advanced tips of dbms statas
Advanced tips of dbms statasAdvanced tips of dbms statas
Advanced tips of dbms statas
 
Watch Re-runs on your SQL Server with RML Utilities
Watch Re-runs on your SQL Server with RML UtilitiesWatch Re-runs on your SQL Server with RML Utilities
Watch Re-runs on your SQL Server with RML Utilities
 
Dynamic websites lec3
Dynamic websites lec3Dynamic websites lec3
Dynamic websites lec3
 
MySQL Presentation
MySQL PresentationMySQL Presentation
MySQL Presentation
 
Introduction to-mongo db-execution-plan-optimizer-final
Introduction to-mongo db-execution-plan-optimizer-finalIntroduction to-mongo db-execution-plan-optimizer-final
Introduction to-mongo db-execution-plan-optimizer-final
 
Introduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizerIntroduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizer
 
Performance tuning a quick intoduction
Performance tuning   a quick intoductionPerformance tuning   a quick intoduction
Performance tuning a quick intoduction
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
Sqlapi0.1
Sqlapi0.1Sqlapi0.1
Sqlapi0.1
 
SQL2SPARQL
SQL2SPARQLSQL2SPARQL
SQL2SPARQL
 
Web Developer make the most out of your Database !
Web Developer make the most out of your Database !Web Developer make the most out of your Database !
Web Developer make the most out of your Database !
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Pl sql using_xml

  • 1. PL/SQL using XML (Excel output). Following are the prerequisites for setting output in excel using PL/SQL with XML. 1. Layout needs to be designed in Excel (XML Spread Sheet). Consider an example of a simple tabular report: Excel layout has 2 columns Part number & Description. Requirement is report should open in excel with data pertaining to 2 columns mentioned. Put dummy data on the excel sheet with appropriate fonts used. Once layout & dummy data is designed then save the excel spread sheet as .xml. E.g. save with test.xml. 2. Define Executable & concurrent program for this excel o/p.Executable will be defined as a PL/SQL stored procedure. Please refer to screen shot below.
  • 2. Define concurrent program of output format as HTML: Refer to screen shot below. Concurrent program type should be HTML. 3. Once the above step is defined there are profile set up required for excel o/p to work. Profile name: Viewer: Application for HTML Need to set at Site Level: Select LOV's it should say either Excel/Browser.
  • 3. If LOV doesn’t shows Excel then need to perform the following step Go to System administrator->Install->Viewer Options. Search for File format HTML.if not present create a new one. File Format: HTML Mime Type: application/vnd.ms-excel Description: Microsoft Excel Allow Native Client coding checkbox: Checked. Once this is done you should be able to open reports on excel. 4. Need to create a package for generating code in excel. PROMPT CREATING PACKAGE SPECIFICATION FOR xxc_test_pkg CREATE OR REPLACE PACKAGE xxc_test_pkg AS -- PROCEDURE main (errbuf OUT VARCHAR2, retcode OUT NUMBER ); -- END xxc_test_pkg; PROMPT CREATING PACKAGE BODY FOR xxc_test_pkg CREATE OR REPLACE PACKAGE BODY xxc_test_pkg AS PROCEDURE new_row IS BEGiN fnd_file.put_line(fnd_file.output,'<Row>') ; END ; PROCEDURE end_row IS BEgiN fnd_file.put_line(fnd_file.output,'</Row>') ; END ; FUNCTION print_header RETURN NUMBER IS lv_text varchar2(32767) :='<?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Author>fz155</Author>
  • 4. <LastAuthor>fz155</LastAuthor> <Created>2007-05-07T12:36:22Z</Created> <Company>Cummins Inc</Company> <Version>11.8122</Version> </DocumentProperties> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>7956</WindowHeight> <WindowWidth>14143</WindowWidth> <WindowTopX>456</WindowTopX> <WindowTopY>14</WindowTopY> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Bottom"/> <Borders/> <Font/> <Interior/> <NumberFormat/> <Protection/> </Style> <Style ss:ID="s21"> <Borders> <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/> <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> </Borders> <Font x:Family="Swiss" ss:Bold="1"/> </Style> <Style ss:ID="s22"> <Borders> <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/> <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2"/> <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2"/> </Borders> <Font x:Family="Swiss" ss:Bold="1"/> </Style> <Style ss:ID="s23"> <Alignment ss:Vertical="Bottom" ss:WrapText="1"/> </Style> </Styles> <Worksheet ss:Name="Data"> <Table ss:ExpandedColumnCount="66000" ss:ExpandedRowCount="66000" x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="51.326732673267323" ss:DefaultRowHeight="12.831683168316831"> <Column ss:Width="67.009900990099013"/> <Column ss:AutoFitWidth="0" ss:Width="325.78217821782175"/> <Row ss:AutoFitHeight="0" ss:Height="13.544554455445544"/> <Row ss:AutoFitHeight="0" ss:Height="13.544554455445544"> <Cell ss:StyleID="s21"><Data ss:Type="String">Part Number</Data></Cell> <Cell ss:StyleID="s22"><Data ss:Type="String">Description</Data></Cell> </Row> <Row ss:AutoFitHeight="0"> <Cell ss:StyleID="s23"><Data ss:Type="String">Test</Data></Cell> <Cell ss:StyleID="s23"><Data ss:Type="String">Testing data</Data></Cell>
  • 5. </Row> <Row ss:AutoFitHeight="0"> <Cell ss:StyleID="s23"><Data ss:Type="String">Test</Data></Cell> <Cell ss:StyleID="s23"><Data ss:Type="String">Tetsing data</Data></Cell> </Row> '; BEGIN FND_FILE.PUT_LINE(FND_FILE.OUTPUT,lv_text); RETURN (1); --------- EXCEPTION --------- WHEN OTHERS THEN FND_FILE.PUT_LINE(FND_FILE.OUTPUT,SQLERRM); RETURN (0); END print_header; PROCEDURE print_footer IS lv_text varchar2(32000) :=' </Table> <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> <Unsynced/> <Print> <ValidPrinterInfo/> <HorizontalResolution>600</HorizontalResolution> <VerticalResolution>600</VerticalResolution> </Print> <Selected/> <Panes> <Pane> <Number>3</Number> <ActiveRow>19</ActiveRow> <ActiveCol>1</ActiveCol> </Pane> </Panes> <ProtectObjects>False</ProtectObjects> <ProtectScenarios>False</ProtectScenarios> </WorksheetOptions> </Worksheet> </Workbook>'; BEGIN fnd_file.put_line(fnd_file.output,lv_text); END; -- PROCEDURE main (errbuf OUT VARCHAR2, Retcode OUT NUMBER ) IS CURSOR c_part IS SELECT segment1, description FROM mtl_system_items WHEREROWNUM<=20; r_part c_part%ROWTYPE; BEGIN IF print_header > 0 THEN
  • 6. NULL; END IF; OPEN c_part; LOOP FETCH c_part INTO r_part; EXIT WHEN (c_part%NOTFOUND); new_row; FND_FILE.put_line(fnd_file.output,'<Cell ss:StyleID="s23"><Data ss:Type="String">'||r_part.segment1||'</Data></Cell>'); FND_FILE.put_line(fnd_file.output,'<Cell ss:StyleID="s23"><Data ss:Type="String">'||r_part.description||'</Data></Cell>'); end_row; END LOOP; CLOSE c_part; print_footer; END main; -- END xxc_test_pkg; 5. Deploy the Above Concurrent program in request group & execute this package. View o/p when clicked will ask for LOV’s Browser/Excel. Select Excel o/p will open in excel.