Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Generating an Excel Report

by dragonchild (Archbishop)
on Mar 02, 2004 at 12:39 UTC ( [id://333234]=note: print w/replies, xml ) Need Help??


in reply to Re: Generating an Excel Report
in thread Generating an Excel Report

Alternately, you could use Excel::Template, which uses Spreadsheet::WriteExcel.
use Excel::Template; my $template = Excel::Template->new( filename => 'template.xml', ); $template->param( hello => 'Hi Excel!', value => 1.2345, formula => '=SIN(PI()/4)', ); $template->write_file('perl.xls'); -------- template.xml -------- <workbook> <worksheet> <row> <bold> <cell><var name="hello" /></cell> </bold> <cell col="+1" text="$value" /> <formula><var name="formula" /> </row> <cell row="1" col="0"><var name="hello" /></cell> </worksheet> </workbook>

I don't have all the formatting options built in, yet, but the rest of it works. It takes the same data structure as HTML::Template, so it's really good for building reports. (My current job has me using HTML::Template, Excel::Template, PDF::Template, and Graph::Template for this very purpose.)

------
We are the carpenters and bricklayers of the Information Age.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: Re: Generating an Excel Report
by kasmot (Novice) on May 04, 2004 at 05:06 UTC
    Hi.. Im sorry but could you teach me how do I insert this code on my perl program??
      It's just like any templating system. You have two files - the Perl script and the template file. The Perl script has the Perl code in it and the template file has the XML in it.

      ------
      We are the carpenters and bricklayers of the Information Age.

      Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://333234]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 21:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found