Generating OpenOffice documents (ODF)

 

OpenOffice Writer document format is supported since XFRX version 11.2. Since 12.0, the Writer and Calc outputs are supported, both of which can be generated either using the absolute or flow layout formats (please see chapter Flow layout document option on page 28 for more information about the flow layout options).

OpenOffice is using the OASIS Open Document Format (ODF) for Office Applications, which is also supported by a variety of other office applications including StarOffice, KOffice, and IBM Workplace.

XFRX generates the file formats natively, so OpenOffice doesn’t have to be installed on the computer where the document is generated.

You can find more information about the OASIS Open Document Format at

http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office.

More information about OpenOffice can be found at http://www.openoffice.org.

To generate the OpenOffice document, use the following codes as the 7th parameter (targetType) of the SetParams method:

Document type

targetType

value

OpenOffice Writer document with absolute layout

ODT

OpenOffice Writer document with flow layout

FODT

OpenOffice Calc spreadsheet with absolute layout

ODS

OpenOffice Calc spreadsheet with flow layout

FODS

OpenOffice Calc spreadsheet with flow layout - PlainPFODS 

How to invoke the ODT/ODS output

It is pretty much the same as with the other targets:

LOCAL m.loSession, m.lnRetval
m.loSession= xfrx("XFRX#INIT")
m.loSession.initLog()
m.lnRetVal = m.loSession.SetParams("output.odt",,,,,,"ODT")
IF m.lnRetVal = 0
   m.loSession.ProcessReport("report1")
   m.loSession.finalize()
ENDIF

Developer Folder

Call SetOtherParams method with "DEVELOP" or "DEVELOPFOLDER" to define output folder for source files and folders of ODF.

Example:   

m.loSession.setOtherParams("DEVELOP",.T.)
m.loSession.setOtherParams("DEVELOPFOLDER","[FOLDER\]DEVELOPFOLDER")

Info fields

You can  put one to four custom fields into ODF file. The keywords are INFO1, INFO1_NAME,  INFO2, INFO2_NAME,  INFO3, INFO3_NAME, INFO4, INFO4_NAME.
Call SetOtherParams method with "INFO1" and "INFO1_NAME" to define INFO1 value and name.

Example:    

m.loSession.setOtherParams("INFO1", "AnyValue")
m.loSession.setOtherParams("INFO1_NAME","Field 1") 

Language/Country specification

XFRX get Language/Country specification from OS locale informations, but you can call SetOtherParams method with "FO_LANGUAGE" and "FO_COUNTRY" to define own values.

Example:    

m.loSession.setOtherParams("FO:LANGUAGE", "CS")
m.loSession.setOtherParams("FO:COUNTRY", "CZ")

ODS/FODS/PFODS other parameters

The parameters DISPLAY_GRID_LINES, SHEET_PER_PAGE, NEXT_SHEET_NAME, NEXT_SHEET_NAME_EXPR, LEAVE_FULL_FIELD_CONTENT, ADDPAGENUMBERTOSHEETDISPLAYNAME,  SHEETPAGEBREAK are same such as for XLS/XLSPLAIN.

ODT/FODT other parameters

The parameters NEXT_PAGE_NAME, NEXT_PAGE_NAME_EXPR are euqal to NEXT_SHEET_NAME, NEXT_SHEET_NAME_EXPR.Â