Crystal Report 需要很长时间才能通过网络打印机打印

时间:2020-12-23 08:04:33

标签: c# asp.net-web-api printing crystal-reports network-printers

使用asp.net webApi 中的存储过程创建了一个水晶报表并尝试通过打印 网络打印机在 A6 纸上使用多用途托盘,但从本地主机打印需要很长时间,并且在 iis 部署后需要更多时间(大约 1 分钟)。

非常感谢您的帮助。

                IDTagSP rpt = new IDTagSP();
                rpt.SetDatabaseLogon("sa", "xxxxxxxx", "xxxxxx", "EC_CompTraceability");
                rpt.SetParameterValue("@pono", PM.PONO);
                rpt.PrintOptions.PrinterName = printername;
                SetDefaultPrinter(printername);
                System.Drawing.Printing.PaperSource pkSource = new 
                System.Drawing.Printing.PaperSource();
                pkSource.RawKind = 4;
                pkSource.SourceName = "Multipurpose tray";
                rpt.PrintOptions.CustomPaperSource = pkSource;
                int rawKind = 257;
                rpt.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)rawKind;
                //PrintReportOptions options = new PrintReportOptions();
                //options.PrinterName = printername;
                //options.PaperSize = (CrPaperSizeEnum)rawKind;
                //options.PaperSource = (CrPaperSourceEnum)pkSource.RawKind;
                //rpt.ReportClientDocument.PrintOutputController.PrintReport(options);
                rpt.PrintToPrinter(1, false, 0, 0);

0 个答案:

没有答案