I want to print c# windows form by printer.when i click print button i开发者_开发知识库n form, a print dialog should open just like when we give any notepad or doc file to print.and i should be able to print the report or invoice.how to do it?
Use PrintDocument
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument(v=VS.100).aspx
Hope this helps.
Edit:
Also see http://msdn.microsoft.com/en-us/library/system.windows.forms.printdialog.aspx if you are interested in dialog options.
check out http://msdn.microsoft.com/en-us/library/system.drawing.printing.aspx I think you will find what you need there
You can use reporting services to generate a report based on whatever values are on the screen and then use the ReportViewer control to display and print the file.
I can't give you much guidance on how to do that off the top of my head but you could google winforms reporting services print and see what comes up...
精彩评论