Thread

Posted on Fri Sep 8 17:57:16 2006 by glider
new user questions
i am using this wonderful module to create my reports out of postgresql.
my questions :

1. how can a change the layout of a table . i supplied the table-style parameter, but that doesn't change anything
2. the default writer fonts seem to be all the same : all helvetica. How can i change this.
3. i suppose that it's recommended to work with a template. does this template have to go in the dir OOdoc/templates, does it need to be unzipped, or can it just be a plain file ?

regards

jef peeraer
Direct Responses: 2987 | 2988 | Write a response
Posted on Sun Sep 10 23:11:26 2006 by jmgdoc in response to 2972
Re: new user questions
Changing a full table layout programmatically is very tricky and sleeveless.
To do so, you have to affect a style to every cell, every row, every column. The style of the table object controls a few global properties only. Using templates is a good idea.

See createStyle() in the OpenOffice::OODoc::Styles manual page. There is an example of style creation with an explicit "Times" font selection. Caution, only the fonts which are "declared" in the current document are effective. If you want to use a font which doesn't belong to the default set, you have to import its declaration. See importFontDeclaration() in OpenOffice::OODoc::Style.

Any regular document can be used as a template. Example:
my $doc = ooDocument(file => "template.odt"); # update the document $doc->save("target.odt");

As long as a file name is provided to the save() method, the original file in unchanged, so it's used as a template and the result is saved to the target file. An alternative option consists of using one or more documents in order to extract a few selected styles, font declarations or text containers (such as tables) and use them in a target document. As an example, a single document could play the role of styles database. Of course, the user can customize the OpenOffice::OODoc installation in order to replace the default templates which are used by ooDocument() each time the "create" option is set, but it's seldom required.
Write a response
Posted on Sun Sep 10 23:20:06 2006 by jmgdoc in response to 2972
Re: new user questions
Could you please choose more instructive headings for future posts?
Subjects such as "new user questions" are not very helpful
Thanks ;-)
Write a response