|
Looks like there's no way to set type or style on multiple table cells.
The following - getting cell rows and indexing vs getTableCell is much
faster. Not a lot of examples out there so maybe this can help someone.
my $doc = odfDocument(file => $output_file, create => 'spreadsheet');
my $sheet = $doc->expandTable(0, $Rows, $Columns);
my @tblrows = $doc->getTableRows($sheet);
my $X=0; my $Y=0;
for my $row ( @$result_rows ) { #DBI fetchall_arrayref results
my $tblrow = $tblrows[$X];
my @cells = $doc->getRowCells($tblrow); #get open cells for 1st row
for my $fld(@$row) {
$doc->cellValueType($cells[$Y], "$type");
$doc->cellValue($cells[$Y], "$fld");
$doc->cellStyle($cells[$Y], "stylename");
}
}
|