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);
使用代码去打印,仍然卡死。前提是按照我描述的"断开打印机那端的网络"(不是断开本机电脑的网络)去操作。 |