views:

1363

answers:

3

For document exchange, I would like to generate OpenOffice.org text and spreadsheet documents. So far I have found export components which require OpenOffice to be installed, using OLE.

Are there already Delphi components available which can write native files for OpenOffice.org Writer or OpenOffice.org Calc?

+2  A: 

It depends on how complicated your documents are, and how much effort you want to invest.

OpenOffice.org documents (starting with version 2 of OO.org) are files in the OpenDocument Format, basically zipped directories with a documented structure, containing various XML and support files. You can use for example the "Open Inside" command of 7-Zip to navigate the files like a directory.

That gives you at least the following options:

  • Write the code to output the documents yourself, the Delphi stream classes and compression support should be sufficient. This is obviously the most difficult way, but you would have everything under your control.

  • Save minimal documents as template files and add them to your application as external support files or even as embedded resources. When a file needs to be written you copy the template and edit the content.xml file in the root directory. This should be a lot easier, a way I would probably go to create for example a simple spreadsheet file with several sheets and columns of data.

  • If you already have the license or don't mind to pay for it, FastReport VCL supports "Open Document Format for Office Applications (OASIS) exports, spreadsheet (ods) and text (odt)". Maybe there are other reporting solutions as well, but FastReport is the one I'm sure of.

mghie
A: 

I have an ActiveX DLL based solution. It will help embed OpenOffice apps in your application and you can automate them just like MSOffice Apps.

If you feel interested please post me an email @ yogiyang 007 at g m a i l . c o m

(Please remove all excess spaced)

Yogi Yang 007
A: 

FPC/Lazarus' fpspreadsheet component can directly write older Excel formats, and OOO can open them. If you need spreadsheets rather than textdocuments, it could be an option to see if it can be ported to Delphi.

Marco van de Voort