Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easiest way to create dynamic-content documents (like invoices, delivery notes)

I was searching the web with a few results, but none of them seems to fit the task. I was looking für possibilites for .NET, but would also like to know how Java/PHP/etc. developers finish tasks like this.

As far as I found out, I have the option to:

  1. Use MigraDoc/PDFSharp and go the "code" way, without any visual designer

  2. I could use HTML and convert it to a PDF (which is the best approach in theory, but practically it's awful to get good looking HTML 1:1 into a PDF file)

  3. I could use some weird MS Word templateing/batch stuff

  4. LaTeX?

What are your solutions?

like image 774
David Avatar asked Mar 02 '11 15:03

David


7 Answers

We use SoftArtisans OfficeWriter

like image 195
Cosmin Avatar answered Oct 31 '22 06:10

Cosmin


A solution that we settled on in a previous project was XSL-FO. Although it did not have a visual designer, we found it to be very developer friendly and more suitable to run in a server type environment. It also deals with document "flow" a lot better than most of the reporting software that offer a designer. I do know that we had a lot of trouble with Crystal Reports around deployment, COM exceptions being thrown and limitations on how many reports can be generated concurrently. One downside to using XSL-FO is all the syntactic sugar that comes with XML.

This question lists a few XSL-FO engines.

like image 20
Sir Rippov the Maple Avatar answered Oct 31 '22 06:10

Sir Rippov the Maple


Regarding your "3.) weird MS Word templateing/batch stuff":

I love to use Aspose.Words, a commercial package to create/edit/export Microsoft Office Word documents, without any Office components being installed.

Aspose.Words is capable of doing Mail Merge stuff and write PDF files, so I often start on my desktop computer with a DOC that I edit in Word and use this with Aspose.Words on my server to produce PDFs.

like image 42
Uwe Keim Avatar answered Oct 31 '22 07:10

Uwe Keim


One method I've used before for Windows desktop applications is to use XAML/WPF. The nice thing about this solution is that there are a lot of good tools and documentation around building layouts with XAML. Then you just pass the canvas to a PrintDialog and you're done. If you've been doing a lot with WPF/XAML already this is a very easy solution and I've had a lot of success with it. I learned most of what I needed to get started here: http://www.switchonthecode.com/tutorials/printing-in-wpf

The downside, of course, is your dependency then on .NET and WPF.

like image 33
Matthew Bonig Avatar answered Oct 31 '22 08:10

Matthew Bonig


Similar to Matt Fs solution of using Crystal Reports, I use SQL Server Reporting Services. You can create add a rdlc file to your solution and use the WYSIWYG editor to design your report. Then in your code, all you have to do it assign your data source to your report in code and it should work. This even supports exporting to PDF.

like image 22
cadrell0 Avatar answered Oct 31 '22 07:10

cadrell0


Seems as no-one has mentioned Latex-based solutions, there was a stack overflow Tex question answered by jason. Short version: uses MikTex, beautiful documents, big hassle to use build/maintain.

like image 36
Cameron Stone Avatar answered Oct 31 '22 07:10

Cameron Stone


Thanks for all your answers...

I finally decided to implement my own solution using Visual Studio 2010 and the Office-Tools... This is not the "perfect" solution, but it was easy & fast to implement, while i still have the flexibility to change the documents witch excel or word...

Downside of course: You need Office installed.

like image 44
David Avatar answered Oct 31 '22 08:10

David