[Catalyst] Data export question
Kenneth S Mclane
ksmclane at us.ibm.com
Mon Jul 2 19:08:03 GMT 2012
I already have some rough code for Spreadsheet::WriteExcel. I just need to
figure out how to pass it the data. I created a new controller just to do
the Excel piece, I think I should be able to pass the same resultset to
the export routine as I do to the stash for the template code. Just not
sure of the logistics, but I need to do this for multiple pages.
I'm thinking I can pass the same $rs I place in the stash to the export
function, have it stuff it into an excel file and return a uri which I can
redirect the browser to.
Maybe.
Len Jaffe <lenjaffe at jaffesystems.com> wrote on 07/02/2012 01:54:28 PM:
> From:
>
> Len Jaffe <lenjaffe at jaffesystems.com>
>
> To:
>
> The elegant MVC web framework <catalyst at lists.scsys.co.uk>
>
> Date:
>
> 07/02/2012 01:56 PM
>
> Subject:
>
> Re: [Catalyst] Data export question
>
>
> On Mon, Jul 2, 2012 at 1:45 PM, Kenneth S Mclane <ksmclane at us.ibm.com>
wrote:
> It will just be a dump of the current query results, possibly a
> whole table, so It will need to create new tabs when they reach 65K
> since most of my users are still on office 2003. I guess I could use
> Spreadsheet::WriteExcel, I just need to figure out the mechanics of
> getting the data into the sheetand something to keep track of the
> number of rows and create new tabs as needed.
>
> # psuedocode
>
> $ss = open_spreadsheet()
> $i = 0;
> $tab = undef;
> foreach $row (@rows) {
> if ($i % 65000 == 0) {
> $tab = $ss.new_tab()
> }
> add_to_spreadsheet($row, $tab)
> $i += 1
> }
> close_spreadsheet()
>
>
> L.
> --
> lenjaffe at jaffesystems.com 614-404-4214
www.volunteerable.net
> Proprietor: http://www.theycomewithcheese.com/ - An Homage to Fromage
> Greenbar: Grubmaster: 2012-2009, Grub Asst: 2008, Trained: 2007.
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120702/cea8bf73/attachment.htm
More information about the Catalyst
mailing list