The way to control the row height needs a different
approach.
<br>
Knowing that a row probably uses an existing automatic style
(attributed by the spreadsheet editor), and that this style
is possibly shared whith one or more other rows, we have to
execute the following operations:<br>
<br>
1) Normalize the table (according to the appropriate size)
in order to ensure that the target row is not a repeated
row;<br>
2) Get the existing style of the target row, using
rowStyle();<br>
3) Create a new row style using the old one as a prototype,
changing the style:row-height and
style:use-optimal-row-height attributes only; caution, as
long as it's an automatic style, it's hosted in the document
content, not in the "styles" member;
3) Replace the old style by the new one using rowStyle()
again.<br>
<br>
That's all. As an example, the following code works for me;
please tell us if it works for you...
<code>
my $content = ooDocument(file => "foo.ods",
member => "content");
my $table = $content->getTable("Sheet1", 50,
50);
my $row = $content->getRow($table, 0);
my $old_style = $content->rowStyle($row);
$content->createStyle
(
"new_unique_style_name",
prototype => $old_style,
properties =>
{
"style:row-height" => "2cm",
"style:use-optimal-row-height" =>
"false"
}
);
$content->rowStyle($row,
"new_unique_style_name");
$content->save;
</code>
To write a respons, access
http://ww
w.cpanforum.com/response_form/3437
To see the full thread, access
http://www.cpan
forum.com/threads/3366
--
You are getting this messages from www.cpanforum.com
To change your subscription information visit http://www.cpanforum.
com/mypan/
|