Hi. I need to make OO Calc reports dynamically. How I can do it? Thanks

Win 7 x32, VS2010 C#

Recommended Answers

All 3 Replies

That depends on what you mean by "dynamically".

The Apache OpenOffice API Project

COM Interop Tutorials

If your needs are simple you might find you can get away with writing Calc documents directly, rather than automating OpenOffice. Calc documents are zipped files and the contents are mostly XML based. It's an open format and reasonably well [cough] documented. So if you know a little XML it shouldn't be too difficult to modify an existing file.

The disadvantage of this approach comes when the OpenOffice format is revised you may need to update your output accordingly.

Automating OpenOffice will help to maintain compatibility, but you need to bear in mind that it is essentially an interactive application. If you are running your software as a service and OpenOffice unexpectedly decides to throw up a dialog box, it will not be seen by the user. Instead your application will appear to hang, while it is waiting for the user's response.

Documentation for the OpenOffice API includes support for several languages, but doesn't explicitly mention csharp. There may be a better way to automate OO, but you should find using the OLE interface in combination with COM Interop will do the trick.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.