CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate: Unable to create spreadsheet in cgi script: Edit Log


Jul 4, 2013, 6:57 PM

Views: 2462
Unable to create spreadsheet in cgi script

hi folks,

I am trying to download xlsx from cgi page in browser but not sure where I made a mistake.

the cgi script contains the code for creating xlsx and just by clicking on the image I should be able to

#!/usr/bin/perl -w 
use Excel::Writer::XLSX;
use DBI;
use DBD::mysql;
use CGI;
use CGI qw(:standard);
use CGI::Carp qw ( fatalsToBrowser );

$q=new CGI;

$report_year = $q->param('Field_year');
$report_month = $q->param('Field_month');
$report_year = $q->param('Field_year');
$string="$report_month"." "."$report_year"." "."Network Availability Report";


my $workbook = Excel::Writer::XLSX->new("$report_name");
my $worksheet = $workbook->add_worksheet($report_month);

print "Content-type: text/html\n\n";
print '<html>';
print '<head>';
print '<title>Hello Word - First CGI Program</title>';
print '</head>';
print '<body>';
print "<h2>$report_month</h2>";
print "<h2>$report_year</h2>";
#print qq~<a href="$report_name"><img src="" width=40 height=40></a>~;
print '</body>';
print '</html>';


If I click on the image then I need to open the spreadsheet.

I have managed to execute the same in windows and able to display it on windows.

Now I am deploying the code in unix but failed to display this cgi script.


Can't call method "add_worksheet" on an undefined value at /srv/www/cgi-bin/gnsncc/temp_final_report.cgi line 20.

I made sure that all the scripts has 755 permissions.

I am executing the scripts from cgi-bin folder.

Could anyone please let me know what went wrong.


(This post was edited by giridhar276 on Jul 4, 2013, 7:02 PM)

Edit Log:
Post edited by giridhar276 (Novice) on Jul 4, 2013, 7:02 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives