你好,这个的话WInform的打印是使用的后端的打印,你可以在后端的打印方法里写打印对应的方法 ,然后进行判断,打印是否已经完成具体的打印代码如下:
- private void tsbPrint_Click(object sender, EventArgs e)
- {
- string file_name = @"..\..\RdlReport1.rdlx";
- GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(file_name));
- pageReport.Document.LocateDataSource += new LocateDataSourceEventHandler(LocateData);
- pageReport.Document.Printer.DefaultPageSettings.Margins.Bottom = 0;
- pageReport.Document.Printer.DefaultPageSettings.Margins.Left = 0;
- pageReport.Document.Printer.DefaultPageSettings.Margins.Right = 0;
- pageReport.Document.Printer.DefaultPageSettings.Margins.Top = 0;
- pageReport.Document.Printer.PaperSize.RawKind = 0;
- pageReport.Document.Printer.PaperSize.Width = 14;
- pageReport.Document.Printer.PaperSize.Height = 20;
- pageReport.Document.Printer.PrinterName = "打印机名";
- GrapeCity.ActiveReports.PrintExtension.Print(_document, true, true);
- }
复制代码 然后再打印的最后写一个打印是否结束的弹出窗口
|