Skip Menu |

This queue is for tickets about the OpenOffice-OODoc CPAN distribution.

Report information
The Basics
Id: 15661
Status: resolved
Priority: 0/
Queue: OpenOffice-OODoc

People
Owner: Nobody in particular
Requestors: japanexpress2003 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.014
Fixed in: (no value)



Subject: getCellValue don't return any value if empty cells before the reqested cell
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
[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.
[JMGDOC - Thu Nov 10 15:08:49 2005]: Show quoted text
> 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.
Yes that was the trick. Many thanks.