Here is a wrapper for the Open Office command line: OpenOffice.pm
Elements of Report Program
Use OODoc to unpack the template
Make modifications to document
Clean up any formatting issues
Save the result
Send to OpenOffice for conversion
Helpful Tips
Define as much as possible through Open Office program
Change the template to use only styles
Wait times when processing
Big changes are easy, little changes are hard
Tables
Table formatting is tricky, create empty tables in the template and copy them in the code.
OpenOffice::OODoc cannot 'see' merged cells or access them via row/column addressing. Use 'selectElementsByContent'
Give each table a name so that it can be addressed from the code
Visual layout is easier via the Open Office interface, sizing and formatting are painful from code, use styles!
Images
OpenOffice::OODoc has no facility for guessing the sizes of images. You need to specify the size of the image (in centimeters)
PNG, GIF, or JPG images are no problem, but if you want good quality printouts, set the DPI high or oversize the image and force it smaller in the size parameter
For whatever reason, correctly putting a style on an image seems to be impossible. Use Tables to move images around the screen
Examples
The best way to learn this is through examples, so let's walk through a few!