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
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