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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top