Hi. I need to make OO Calc reports dynamically. How I can do it? Thanks
Win 7 x32, VS2010 C#
Hi. I need to make OO Calc reports dynamically. How I can do it? Thanks
Win 7 x32, VS2010 C#
That depends on what you mean by "dynamically".
As I understand your question, you need to automate OpenOffice. I can advise you to include LibOpenOffice (http://4k.com.ua/products/others/libopenoffice). It must help you
The Apache OpenOffice API Project
http://www.openoffice.org/api/
COM Interop Tutorials
http://msdn.microsoft.com/en-us/library/aa645712%28v=vs.71%29.aspx
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.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.