I have used to Microsoft Report wizard to create a Report (a delivery receipt) for a Transport application.开发者_如何学Python Now I want the end user to be able to print the receipt as soon as he clicks a button. The problem is that on click of a button the report is first loaded and then he has to select the print button. I want to automate the process of loading and printing. The guy has to print about 200-300 receipts a day and it is very time consuming to follow the current method!
I am developing using C# and working on Microsoft visual studio 2010. I am working on winForms desktop application and the report is local
Have a look at this: http://msdn.microsoft.com/en-us/library/ms252091.aspx
It generates a file and prints that to the default printer. I have used this a derivative of this before, and it worked OK (if I remember correctly) but I had to add some code to clear down the EMF file once printed.
Seems like a lot of code to do something so simple, but it may help?
If you are using crystal report, you could use ReportDocument.PrintToPrinter
method. Have a look at this.
精彩评论