Perl module to generate Excel XML

Discussion in 'Perl Misc' started by Ravi Krishna, Jan 22, 2004.

  1. Ravi Krishna

    Ravi Krishna Guest

    Hi,

    I need to generate XML reports in Perl which can be read by Excel.
    I get the data from database using Perl DBI/DBD.

    Excel has the capability to directly read a XML file and display it,
    while preserving all fonts, colors etc.

    Is there a module in CPAN (or elsewhere) where I can convert standard row/column
    data into a Excel-XML. A sample of that type of XML is attached below.

    TIA.

    Ravi
    ===========================================

    </ExcelWorkbook>
    <Styles>
    <Style ss:ID="Default" ss:Name="Normal">
    <Alignment ss:Vertical="Bottom"/>
    <Borders/>
    <Font/>
    <Interior/>
    <NumberFormat/>
    <Protection/>
    </Style>
    <Style ss:ID="s21">
    <NumberFormat ss:Format="#,##0"/>
    </Style>
    <Style ss:ID="s22">
    <Font x:Family="Swiss" ss:Italic="1"/>
    </Style>
    <Style ss:ID="s23">
    <Font x:Family="Swiss" ss:Bold="1"/>
    </Style>
    <Style ss:ID="s24">
    <Font x:Family="Swiss" ss:Bold="1"/>
    <NumberFormat ss:Format="#,##0"/>
    </Style>
    </Styles>
    <Worksheet ss:Name="bigbroweek">
    <Table ss:ExpandedColumnCount="24" ss:ExpandedRowCount="22" x:FullColumns="1"
    x:FullRows="1">
    <Row ss:StyleID="s22">
    <Cell><Data ss:Type="String">Client</Data></Cell>
    <Cell><Data ss:Type="String">Searches</Data></Cell>
    <Cell><Data ss:Type="String">GS Searches</Data></Cell>
    <Cell><Data ss:Type="String">B2C Pnrs Booked</Data></Cell>
    <Cell><Data ss:Type="String">B2C Psgrs Booked</Data></Cell>
    <Cell><Data ss:Type="String">B2C Ticketed PNRs</Data></Cell>
    <Cell><Data ss:Type="String">B2C Psgr Ticketed</Data></Cell>
    <Cell><Data ss:Type="String">GS Pnrs Booked</Data></Cell>
    <Cell><Data ss:Type="String">GS Pnrs Psgr</Data></Cell>
    <Cell><Data ss:Type="String">GS Ticketed PNRs</Data></Cell>
    <Cell><Data ss:Type="String">GS Psgrs ticketed</Data></Cell>
    <Cell><Data ss:Type="String">GUI Booking</Data></Cell>
    <Cell><Data ss:Type="String">Pub Booking</Data></Cell>
    <Cell><Data ss:Type="String">Pub Booking value($)</Data></Cell>
    <Cell><Data ss:Type="String">Net Booking</Data></Cell>
    Ravi Krishna, Jan 22, 2004
    #1
    1. Advertising

  2. Ravi Krishna

    AlV Guest

    Ravi Krishna wrote:
    > Hi,
    >
    > I need to generate XML reports in Perl which can be read by Excel.
    > I get the data from database using Perl DBI/DBD.
    >
    > Excel has the capability to directly read a XML file and display it,
    > while preserving all fonts, colors etc.
    >
    > Is there a module in CPAN (or elsewhere) where I can convert standard row/column
    > data into a Excel-XML. A sample of that type of XML is attached below.


    What about writing Excel native file using Spreadsheet::WriteExcel?
    http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-0.42/WriteExcel.pm

    Or is there a strong requirement for XML other than being read by Excel?
    AlV, Jan 22, 2004
    #2
    1. Advertising

  3. "Ravi Krishna" <> wrote:

    > I need to generate XML reports in Perl which can be read by Excel.
    > I get the data from database using Perl DBI/DBD.
    >
    > Excel has the capability to directly read a XML file and display it,
    > while preserving all fonts, colors etc.



    You can create Excel files in the native binary format using
    Spreadsheet::WriteExcel:

    http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/

    I wrote the above module and I am currently working on a version that
    will emit Excel XML. I will hopefully be releasing a preliminary
    version to CPAN in the next 2-3 weeks.

    John.
    --
    John McNamara, Jan 23, 2004
    #3
  4. Ravi Krishna

    Ravi Krishna Guest

    (John McNamara) wrote in message news:<>...
    > "Ravi Krishna" <> wrote:
    >
    > > I need to generate XML reports in Perl which can be read by Excel.
    > > I get the data from database using Perl DBI/DBD.
    > >
    > > Excel has the capability to directly read a XML file and display it,
    > > while preserving all fonts, colors etc.

    >
    >
    > You can create Excel files in the native binary format using
    > Spreadsheet::WriteExcel:
    >
    > http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/
    >
    > I wrote the above module and I am currently working on a version that
    > will emit Excel XML. I will hopefully be releasing a preliminary
    > version to CPAN in the next 2-3 weeks.


    Excellent.
    Thanks Avi and John.
    If it is a wait of only a month, then I would prefer XML.

    Thanks again.
    Ravi Krishna, Jan 23, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Weng Tianxiang
    Replies:
    5
    Views:
    1,308
    Christophe
    Feb 16, 2006
  2. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,495
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  3. Matt
    Replies:
    3
    Views:
    339
    Bob Barrows [MVP]
    Apr 23, 2004
  4. Replies:
    1
    Views:
    292
    Mirco Wahab
    Apr 17, 2007
  5. arun
    Replies:
    1
    Views:
    187
    A. Sinan Unur
    Nov 19, 2008
Loading...

Share This Page