FLEX and Perl Export to Excel
Need to export a Flex Datagrid to Excel CSV?
Here is a link to the Flex code
The flex code will convert the DataGrid to a CSV string. Which you will then post to a cgi….code below.
You can see it in action on my Dividend Reinvestment ToolÂ
#!/usr/bin/perl
use CGI qw(:standard);
my $cgi = new CGI;
my $count = 0;
use CGI::Carp qw(fatalsToBrowser);
$title=$cgi->param('title');
$html=$cgi->param('htmltable');
$type = $cgi->param('type');
if ($type = "CSV") {
print $cgi->header(-expires=>'now', -type=>'application/x-csv', -content_disposition=>"attachment; filename=$title.csv");
print "$html";
}
else {
print $cgi->header(-expires=>'now', -type=>'application/octet_stream', -content_disposition=>"attachment; filename=$title.xls");
print $cgi->start_html(-title => 'Export'
);
print "$html";
print $cgi->end_html;

Aug 2nd, 2008 at 1:02 am
Can you tell me how to call the cgi function from flex?
It does not look like HTTPService will work.