Perl module to generate Excel XML

R

Ravi Krishna

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>
 
A

AlV

Ravi said:
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?
 
J

John McNamara

Ravi Krishna said:
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.
--
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top