[rt-users] Problem with Perl script for RT

Krzysztof Opała Krzysztof.Opala at comarch.pl
Tue Jun 15 05:28:17 EDT 2004


Sorry for disturbing you but I'm completely new to object-oriented Perl,
and I've got a problem that completely not able to cope with:
What I wanna do is put some data about tickets into Excel file (sth like
a report done with Search in RT).
I'm downloaded Spreadsheet::WriteExcel library and tried to make sth
using it. I managed to mage a file starting a perl script from command
line so the library is working. But I really can't make it working with
my RT.
Can anybody show me how to run this in RT using for instance a very
simple code:
 
#!/usr/bin/perl -w
 
use strict;
use Spreadsheet::WriteExcel;
# Create a new Excel workbook called perl.xls
my $workbook = Spreadsheet::WriteExcel->new("perl.xls");
my $worksheet = $workbook->addworksheet();
# Write some text and some numbers
# Row and column are zero indexed
$worksheet->write(0, 0, "The Perl Journal");
$worksheet->write(1, 0, "One" );
$worksheet->write(2, 0, "Two" );
$worksheet->write(3, 0, 3 );
$worksheet->write(4, 0, 4.0000001 );
 
How to make it working run from '/opt/rt3/share/html/Search/' directory
in my RT ?
 
When I try to start it just putting '%' before every line I get:
 
System error

error: 
Can't call method "addworksheet" on an undefined value at
/opt/rt3/share/html/Search/ListingExcel2Report.html line 5.

context: 

1: 
%use strict; 

2: 
%use Spreadsheet::WriteExcel; 

3: 
%# Create a new Excel workbook called perl.xls 

4: 
%my $workbook = Spreadsheet::WriteExcel->new("perl.xls"); 

5: 
%my $worksheet = $workbook->addworksheet(); 

6: 
%# Write some text and some numbers 

7: 
%# Row and column are zero indexed 

8: 
%$worksheet->write(0, 0, "The Perl Journal"); 

9: 
%$worksheet->write(1, 0, "One" ); 

... 
 
 
Lost of thanks in advance - you'll give me a great birthday present ;)
Greets
Krzysztof Opała
Comarch Kraków S.A.
Poland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20040615/a0ee245d/attachment.htm>


More information about the rt-users mailing list