Print without Printer selection dialog

2020-02-13 05:06发布

I want to print my crystal report directly, without printer selection popup. How can I do this ?

myReportDocument.SetDataSource(saveDataSet);
//Print
crystalReportViewer1.ShowRefreshButton = false;
crystalReportViewer1.ShowCloseButton = false;
crystalReportViewer1.ShowGroupTreeButton = false;
crystalReportViewer1.ReportSource = myReportDocument;
crystalReportViewer1.PrintReport();

I'm using the default (and only) printer.

1条回答
一纸荒年 Trace。
2楼-- · 2020-02-13 05:49
myReportDocument.PrintOptions.PrinterName = "PRINTER_NAME";
myReportDocument.PrintToPrinter(copies, collate, startPage, endPage);
查看更多
登录 后发表回答