Alternative to Office Interop for document generation?

I just posted this as an answer to another question about automating Office, but I think it's a suitable response to this question too (especially since you are looking for a free or low cost solution). I've had no end of problems (poor performance, hanging processes, crashing processes etc) using Microsoft Excel, Word and PowerPoint through interop in a web service to print Office documents to PDF format. I too have faced problems that I suspect are because of invisible dialog boxes (maybe a file is corrupt, read-only recommended has been set, file is password protected, or whatever).

I know there are tools available that don't use Office, but they are very expensive. My solution was to switch to automating OpenOffice. OpenOffice seems to be much more stable, and I've left hanging processes and the like behind.So, while I suppose I am saying "don't automate Microsoft Office", I'm not suggesting that you abandon automation altogether; just that I've had much more success automating OpenOffice than Microsoft Office.

Aspose have a number of components in . NET and Java for generating Word, Excel and Powerpoint documents.

Fails, costs a fortune – ohnoesitsbroken Jun 25 '09 at 12:12 1 There's no free lunch i'm afraid. You have to pay SOME price -- actual money, development effort, stability ... you have to pick your poison – Conrad Jun 25 '09 at 13:08 seems we are using the best tool for the job under the circumstances then – ohnoesitsbroken Jun 25 '09 at 13:29 1 there's a huge range between free lunch and steak dinner with shrimp and lobster stuffed with gold dust, which is how I would describe Aspose's pricing. – Samuel Neff Jun 25 '09 at 2:51.

If you have SQL Server, you could look at SQL Server Reporting Services.

Fails, no powerpoint – ohnoesitsbroken Jun 25 '09 at 12:11.

You should take a look at the products available from Aspose. There are a number of different file format components that allow you to create and manipulate PDF and Microsoft Office documents without requiring Office to be installed on the server: File Format Components (Aspose) Software Artisans have some similar components that can read and write Word and Excel documents: Software Artisans OfficeWriter.

Fails, costs a fortune – ohnoesitsbroken Jun 25 '09 at 12:13.

SpreadsheetGear for . NET can handle the Excel file generation. We focus on spreadsheets so we do not have Word or PowerPoint generation.

You can see ASP. NET samples here and download a free trial here. Disclaimer: I own SpreadsheetGear LLC.

Fails, no word, no powerpoint – ohnoesitsbroken Jun 25 '09 at 12:14.

One way we have done this, but not with template files is to create your document template and save it as a word, excel, or ppt document, but in a format where the document remains in human readable text. So for Word and Excel save as mht. Then you can read in the template as a string, and process it with good old fashioned string manipulation functions (replace placeholder text, add rows whatever you need to do) then save the string as a .

Doc, . Xls, or . Ppt (which ever program created it) file and it should open right back up as a document in that application with all your formatting intact.

One tip, you have to check your template in a text editor after you save it in Word. Word will indiscriminately add line breaks so it may line break your placeholders or put other formatting inside them which you may have to clean up.

Fails, not creating real office files – ohnoesitsbroken Jun 25 '09 at 12:14 I tried this once with Office 2003 XML, but I found it often put sentences for no apparent reason across multiple XML tags, which made it a pain to template. – RichardOD Sep 11 '09 at 10:58.

Have a look at OWC (office web components) these were designed for what you are looking to do! I don't know if they can work with templates as it's ages since I have used them but we used to generate spread sheets on the fly then binary write them to the response stream to display them in the browser. I'm not sure if they will completely meet your requirements but worth looking into as a start atleast.

HTH OneSHOT.

Fail, same limitations, seem to be discontinued support.microsoft. Com/kb/317316 – ohnoesitsbroken Jun 25 '09 at 13:24.

Take a look at npoi.codeplex.com/ I use it to create excel documents. Supports ppt and word as well.

Windward Reports does exactly what you want. With Windward you design your documents in Word, Excel, or PowerPoint and then our engine merges that template with the data to create the final document. The engine is available in Java and .

NET and does NOT use Office on the server so it's very fast and does not have the issues you get using interop. Thanks - dave.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions