in reply to Re: Excel::Template and a hash of arrays of hashes
in thread Excel::Template and a hash of arrays of hashes
The XML: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 } );
<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>
|
|---|