David
David

Reputation: 2569

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?

Upvotes: 13

Views: 6720

Answers (11)

David
David

Reputation: 2569

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.

Upvotes: 1

Cameron Stone
Cameron Stone

Reputation: 927

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.

Upvotes: 1

Paul C
Paul C

Reputation: 4776

Crystal reports can be a pain! On a basic level the outsourced developers for our in house software for Works Order, Invoices etc we use Dev Express although I think it can be pricey.

For reports being generated by the software I ended up choosing to have exports into a raw CSV which of course can be opened up by any spreadsheet software

Upvotes: 0

cadrell0
cadrell0

Reputation: 17327

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.

Upvotes: 1

Matthew Bonig
Matthew Bonig

Reputation: 2136

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.

Upvotes: 1

Uwe Keim
Uwe Keim

Reputation: 40736

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.

Upvotes: 1

Cosmin
Cosmin

Reputation: 2385

We use SoftArtisans OfficeWriter

Upvotes: 2

Sir Rippov the Maple
Sir Rippov the Maple

Reputation: 7581

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.

Upvotes: 1

Matt F
Matt F

Reputation: 595

We use Crystal Reports which comes free with Visual Studio. You can easily create a report/document that is bound to a database or unbound.

For example you could suppress the header and footer, expand the details section to be approx. A4 size, then add either bound fields or use parameters for unbound content. Then at runtime for bound documents set the selection formula to only pull in data for one transaction or for unbound documents just pass in the parameters.

A nice feature of Crystal Reports is there are export features, so export to PDF, Word, etc. Also it's easy to auto print to a specified printer.

Upvotes: 0

jbtule
jbtule

Reputation: 31799

We use xaml FixedPage, can use a designer like Kazaml, it has a lot of layout flexablity, and databinding works great with dynamic objects like expando. In code we bind a datacontext and then render that to XPS, since we need the final output to be pdf we use GhostXPS which is free but has to be executed in a separate processs, there are third party fully managed converters for xps to pdf though.

Upvotes: 0

GWLlosa
GWLlosa

Reputation: 24413

It depends on how you get your template documents. For example, if you have others in your organization responsible for generating the "standard" invoice document, you'll probably have a solution that involves mail merges in the Microsoft Word API, because you need to work with Word-formatted input files. Alternately, if you are merely given the specs for the appearance of the document ("Logo in the top-right, 5 inches down, then a horizontal line two inches below that, then... etc.") You could do it entirely in code. Even if you're designing a solution from scratch, take into account who your document suppliers WILL be, and plan accordingly. Finally, if this is from-scratch for a small set of documents that won't change much (i.e., you're starting your own software company and want to send invoices) don't do it. Just buy something off the shelf or use Word :)

Upvotes: 0

Related Questions