Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Printing extracted Excel data into a HTML table

by Ryszard (Priest)
on Dec 09, 2005 at 08:55 UTC ( #515489=note: print w/replies, xml ) Need Help??

in reply to Printing extracted Excel data into a HTML table

My personal favourite is HTML::Template you can do something very simple like this (untested):
<table> <TMPL_LOOP NAME=FINANCIALS> <tr> <td><TMPL_VAR NAME=SALES></td> <td><TMPL_VAR NAME=Q1></td> <td><TMPL_VAR NAME=Q2></td> </tr> </TMPL_LOOP> </table> $template->param(FINANCIALS => [ { SALES => "Low Power Components", Q3 => 3000000, Q4 => 4600000 }, { SALES => "Virtual Wire Products", Q3 => 2700000, Q4 => 2300000 }, ] );
Its then relativly easy to loop thru your Excel output and create the array of hashes needed to fill the template.

Then again, there is always Text::Template to use as well.. ;-)

Replies are listed 'Best First'.
Re^2: Printing extracted Excel data into a HTML table
by Anonymous Monk on Dec 09, 2005 at 15:58 UTC
    Thanks for the very useful suggestion. Glad to know about that 2 modules!

    Can you give example of how to do it with Text::Template. Cause I can't see any example with HTML there in the documentation.

    Given the two choices. What would you choose between the two? When do you use one and not the other?
      I've personally not used Text::Template, but have heard many good things about it. I'm using HTML::Template mostly because of legacy code, and i can produce stuff very quickly.

      Having said that it looks a good deal more flexible than HTML::Template.

      Sorry, i dont have any examples, but as HTML is not different to text in this context, you just need to build your page, and add the parameters you want as described in the documentation.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2022-12-08 22:04 GMT
Find Nodes?
    Voting Booth?

    No recent polls found