[Erp5-users] DOC: how to create an OpenOffice report
Bartłomiej Górny
bartek at redpoint.mn.pl
Fri Jan 20 14:08:15 CET 2006
How to create a report in OpenOffice format
============================================
v 0.1, 2006-01-20
OpenOffice file (*.ods, *.odt etc) is actually a collection of xml files
packed together with zip. If you unzip a file, you'll find a
content.xml file - that's the most interesting one for us.
ERP5 needs two files to create an OO report: a template, which is the
whole OO file, and the "ERP5 OOo template", which will contain
dynamically generated content.
Before proceeding, you need to patch your ERP5OOo module with a patch
you can get from Jerome (soon the patch will be either up for
download or incorporated in the CVS version).
To create an OOo report:
1. Create a template object
Create an OO file (a text doc or spreadsheet, whichever you want);
upload it to your skin directory as an ordinary file.
2. Create a content object
Create another OO file of the same type, put some dummy content into it.
In portal_skins, create an "ERP5 OOo Template"; open the "edit" tab and
upload your file - ERP5 will automatically extract content.xml from it
and make appropriate changes. Go to the "Stylesheet settings" tab, enter
the id of the template object you created before.
3. Create dynamic content
Your "ERP5 OOo Template" object contents is an xml file - you can put
TAL expressions into it, just as you do in ZPTs. Just
be careful and stick closely to the original syntax. If you need advise
how to achieve a particular layout or formatting, just do it in
OpenOffice, save the file, unzip, take a look at content.xml and you'll
know.
4. Use it
If you click "Test" tab, or call the template from a request, it will
generate an OO file and ship it directly to your browser with
appropriate header information.
--
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"
More information about the Erp5-users
mailing list