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:[EMAIL PROTECTED] Behalf Of Mark Stosberg
Sent: Tuesday, August 24, 2004 9:12 AM
To: [EMAIL PROTECTED]
Subject: [cgiapp] Re: Report generation...


On 2004-08-24, franki <[EMAIL PROTECTED]> 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/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to