I should mention that I use Text::CSV and Text::CSV_XS (the difference being pure perl vs. not AND that the XS version supports binary data in the fields).
# Output
use Text::CSV_XS;
my $csv_out = Text::CSV_XS->new( {'binary' => 1});
while ( my @row = $sth->fetchrow_array ) {
if ( !( $csv_out->combine( @row ) ) )
{ # die if combine fails
die "output failed: ", $csv_out->status(), "\n";
}
$out .= $csv_out->string();
$out .= "\n";
}
# testing only
# my $t = $self->load_tmpl('simpleText.tmpl',die_on_bad_params=>0);
# $t->param( output_text => $out,);
# return $t->output;
# this is the correct, documented way to do this
$self->header_props(
"-type" => 'application/x-download',
"-Content-Disposition" => "attachment; filename=$filename",
);
return $out;
-----Original Message-----
From: news [mailto:suppressed Behalf Of Mark Stosberg
Sent: Tuesday, August 24, 2004 9:12 AM
To: suppressed
Subject: [cgiapp] Re: Report generation...
On 2004-08-24, franki <suppressed> wrote:
>
> Any idea if that works with openoffice?
I just checked it and it works perfectly and seamlessly on OpenOffice. I
use OpenOffice on my own desktop as my primary office suite.
> It is ironic that we have rtf as an open standard for "word" documents,
> but apart from csv there is no similiar open standard for spreadsheets.
There is SYLK:
http://www.jkrieger.de/programming/delphi/sylk.txt
It also works with MS Office and OpenOffice, I believe.
I have never fussed with generating it from Perl, though. (And it
appears there are no Perl modules on CPAN to help you with it).
Mark
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.