[Rt-devel] Re: [rt-users] Problem with Perl script for RT

Steve Neruda neruda at lithik.com
Tue Jun 15 15:14:09 EDT 2004


Make sure to add debugging everywhere.  Things like really help

my $workbook = Spreadsheet::WriteExcel->new("perl.xls")  or die "couldn 
not create workbook: $!\n";

Ruslan U. Zakirov wrote:

> Krzysztof Opała wrote:
>
>> 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:
>
>
> Comments below.
>
>>
>>  
>>
>> #!/usr/bin/perl -w
>>
>>  
>>
>> use strict;
>>
>> use Spreadsheet::WriteExcel;
>>
>> # Create a new Excel workbook called perl.xls
>>
>> my $workbook = Spreadsheet::WriteExcel->new("perl.xls");
>
> I think that constructor return undef because it can't create perl.xls 
> in CWD. You should use some base dir for *.xls files. Also you can't 
> use one file name.
>
>>
>> my $worksheet = $workbook->addworksheet();
>>
>> # Write some text and some numbers
>>
>> # Row and column are zero indexed
>>
>> $worksheet->write(0, 0, "The Perl Journal");
>>
> [snip]
> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel




More information about the Rt-devel mailing list