I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-05-25 04:18:15.763398-07 by jmgdoc in response to 12721
Re: Spreadsheet access

"world" doesn't appear because the cell that should contain it doesn't exist!
In a newly created ods document, the number and the size of the predefined sheets depends on the document template in use in the OpenOffice::OODoc installation. The default template provides a single sheet with a single cell. Such a configuration, of course, is never convenient, so the user must resize the existing sheet, or create a new one.
In this example, the (20,20) size arguments given with getTable() as useless; such arguments just tell getTable() that we need a normalized 20x20 area, but don't instruct the API to resize the table accordingly. So getTable() should be replaced by expandTable() with the same arguments, and everything should work.
The autoSheetNormalization() instruction is useless in this context, knowing that every table created or expanded by OpenOffice::OODoc is always fully normalized.
So the whole program (assuming that the default spreadsheet template is used) should be like below:
use OpenOffice::OODoc; my $doc = odfDocument( file=>'ttab.ods', create=>'spreadsheet', part=>'content' ); my $sheet = $doc->expandTable(0, 20, 20); $doc->cellValue($sheet,0,0,"hello"); $doc->cellValue($sheet,0,1,"world"); $doc->save;
Direct Responses: 12724 | Write a response