How to apply a style to cell using OpenOffice::OODoc module in Perl?
I tried:
my $container = odfContainer("report1.ods", create => 'spreadsheet');
my $doc = odfDocument (
container => $container,
part => 'content'
);
# Styles
my $styles = odfDocument (
container => $container,
part => 'styles'
);
$styles->createStyle ('TTT',
family => 'cell',
display-name => 'Table Headers',
properties => {
'fo:font-weight' => 'bold',
'fo:color' => '#ffffff',
}
);
{
for (my $x = 0; $x < $X; $x++) {
$doc->columnStyle ($sheet, $x, "TTT"); # does not work
for (my $y = 0; $y < $Y; $y++) {
my $cell = $doc->getTableCell ($sheet, $y, $x);
$doc->cellValueType ($cell, $headers->[$x][1]);
$doc->updateCell ($cell, $data->[$y][$x]);
$doc->setStyle ($cell, 'TTT'); # does not work
$doc->cellStyle ($cell, 'TTT'); # does not work
}
}
}