print report by opening a print dialogue

你说的曾经没有我的故事 提交于 2019-12-11 11:35:27

问题


It is fine if I can print report at client side by opening a print dialogue as well without using any Webviewer.

How can i open a print dialogue at client side?


Edit added code from Comments:

rpt.Run();
rpt.Document.Print(false, false, false); 

I used this code.But this code is server side printer instead of client side printer.Now I want to print directly with print dialogue in Client side


回答1:


Please see the answer at https://stackoverflow.com/a/11419422/51061 . I think this will answer your question completely.




回答2:


you can use PrintPreviewControl, PrintDocument

for printing

PrintDocument printDoc = new PrintDocument();
printDoc.PrintPage += new PrintPageEventHandler(this.printDoc_PrintPage);
printDoc.Print()

for print preview

PrintPreviewDialog dlgPrint = new PrintPreviewDialog();
dlgPrint.Document = printDoc;
dlgPrint.ShowDialog();


来源:https://stackoverflow.com/questions/11322328/print-report-by-opening-a-print-dialogue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!