I'm building a custom CRM and I'd like to know what would be the best way to print an invoice. To me, a simple solution would be to have an HTML template of an invoice form (with an HTML table in it) and then use some control to preview/print/export it. Is there a way to do this? Or is there a better way to accomplish this end?
Any help is greatly appreciated!
You have a number of options available to you.
The best option I can think of is to use the Infragistics Documents engine to create a PDF or XPS document. This provides a relatively easy and flexible way to put your data into a printable format.
Putting your data into HTML, as you've described, is another option. It's a portable format, similar to PDF.
Another option is to use the basic .NET printing functionality, which means you use a System.Drawing.Graphics object to "draw" what you want on the printing "surface." This gives you the most flexibility, and is potentially the best performing of these three approaches - however, this requires some expertise with the System.Drawing namespace to get a useful result.
Thank you for your response. I would like to stick with the HTML then because it is relatively easy to create a template and load data into it.
What object would I use for that and how would I tell it to print the HTML or export it to PDF? Do you have a sample code?