[guest - Wed Nov 9 17:12:49 2005]:
Show quoted text> OpenOffice-OODoc-2.014
> This is perl, v5.8.6 built for i586-linux-thread-multi
> Linux linux 2.6.11.4-21.9-default #1 Fri Aug 19 11:58:59 UTC 2005 i686
> i686 i386 GNU/Linux
> OpenOffice 2.0 (build 2.0.0.1)
>
> When using this small test program
>
> use OpenOffice::OODoc;
> my $doc = ooDocument(file => 'ettTest.ods');
> print($doc->getCellValue("Sheet1","A3"),"\n");
> print($doc->getCellValue(0,2,0),"\n");
>
> And the only cell with any value in the Sheet is A3, you don't get any
> result from getCellValue.
> But if you in the sheet put something in the cell before (A2), you
> will get result from getCellValue
The target document is apparently a spreadsheet. In such a document,
direct cell addressing by logical coordinates is available only in a
previously declared (i.e. preprocessed) area. Your program should work
if you issued a $doc->getTable("Sheet1", $height, $width) before the
first $doc->getCellValue(), with $height and $width defining an area
(beginning in "A1") covering the needed area in the sheet. For example,
say, a $doc->getTable("Sheet1", 5, 5) instruction should allow
subsequent cell addressing up to "E5" in "Sheet1". Unless this
declaration (which is not needed for a table belonging to a text
document), or out of the declared area, the real XML path to get a cell
is unpredictable and can change according to the content of the table,
so the getCellXXX() methods can't reliably work.
See getTable() in the OpenOffice::OODoc::Text manual page:
http://search.cpan.org/dist/OpenOffice-OODoc/OODoc/Text.pod#getTable(number_[,_length,_width])
"getTable() can be used to retrieve a sheet in a Calc document as
well as a table in a Writer document. However, before using any of
the row/column/cell manipulation available methods, a special
preprocessing should be done if the target table is a spreadsheet. See
normalizeSheet() for more information.
A getTable() call with the optional length, width arguments produces
the same effect as an explicit call of normalizeSheet() with the same
arguments."
HTH
Please net me know if the answer above is the right explanation, in
order to allow me to change the status of your request accordingly.