.NET 4.0
I am looking for the easiest way to generate a Word document on our server.
Limitations :
- Server side
- I don't want to install word on the server
- Data source is XML
I tried to generate a DOCX with XSLT which is fast and easy but the only way I could find to validate the generated document is to open it with Word and the only error I get when the document is not valid is "Error while opening document". Not very useful.
Any ideas?
Thanks, Alex
I have used the Word interops, but I hated it. Stick processes, etc!
I found that generating HTML and saving as file with .DOC extension worked better than anything.
Keeping far from office automation at server side is really a good idea (since even Microsoft does not support this scenario).
I have never used, but this lib looks promising. Have you tried it?
A few years back, I worked on a project which used Aspose Word (http://www.aspose.com/categories/.net-components/aspose.words-for-.net/default.aspx) to generate Word documents. The tool does not require Word to be installed. However, it is not a cheap tool. IT tool was relatively easy to use and has a robust .net interface.
You have two options given your setup.
A third, much more crude way would be to write an HTML file and save as .doc, but that is going to cause warnings on the user side with 2007 and later.