How to create an OO spreadsheet?

J

Josef Moellers

Hi,

I'd like to create a small OO spreadsheet.
Apparently the OpenOffice::OODoc module should do the trick, but I can't
get more than a single cell, no matter whether I use the commented out
lines or the two below them:

#! /usr/bin/perl

use warnings;
use strict;
use OpenOffice::OODoc;

my $doc = odfDocument(
file => "accounts.ods",
create => 'spreadsheet',
part => 'content',
);
my $sheet = $doc->normalizeSheet("Sheet1", 10, 10);
# $doc->updateCell($sheet, 1, 1, "One Cell");
# $doc->updateCell($sheet, 0, 0, "Another Cell");
set($doc, 'Sheet1', 0, 0, 'One Cell');
set($doc, 'Sheet1', 1, 1, 'Another Cell');

$doc->save;

exit(0);

sub set {
my ($doc, $sheet, $row, $col, $text) = @_;

my $cell = $doc->getTableCell($sheet, $col, $row);
$doc->cellValueType($cell, 'string');
$doc->cellValue($cell, $text);
}

Does anyone have a hint for me?

TIA,

Josef
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top