Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Excel::Template and a hash of arrays of hashes

by kwaping (Priest)
on Dec 29, 2006 at 17:18 UTC ( [id://592253]=note: print w/replies, xml ) Need Help??


in reply to Re: Excel::Template and a hash of arrays of hashes
in thread Excel::Template and a hash of arrays of hashes

Thank you wfsp, that did the job perfectly! I owe you a beverage of your choice sometime.

The code:
my @outer; foreach my $rep (sort keys %hash) { my @inner; foreach my $detail (@{ $hash{$rep} }) { push @inner, $detail; } push @outer, { rep => $rep, inner => \@inner, } } $template->param( { outer => \@outer } );
The XML:
<workbook> <loop name="outer"> <worksheet name="$rep"> <row> <cell text="Comp_Recid" /> <cell text="ApplicationType" /> <cell text="State" /> <cell text="Count (*)" /> </row> <loop name="inner"> <row> <cell text="$companyid" /> <cell text="$apptype" /> <cell text="$state" /> <cell text="$count" /> </row> </loop> </worksheet> </loop> </workbook>

---
It's all fine and dandy until someone has to look at the code.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found