tangke888 发表于 2024-10-18 21:32:03

如何指定打印的页码

代码执行打印时,如何设置只打印第一页



            GrapeCity.ActiveReports.PrinterSettings printerSettings = new GrapeCity.ActiveReports.PrinterSettings();
            printerSettings.ShowPrintDialog = ishowDiag;//是否显示打印属性对话框 false 不显示
            printerSettings.ShowPrintProgressDialog = true;


               //pageReport.Report.PageWidth = "7.4";
               GrapeCity.ActiveReports.Document.PageDocument pageDocument = new GrapeCity.ActiveReports.Document.PageDocument(pageReport);
               //printerSettings.prst
               pageDocument.Print(printerSettings);

Bella.Yuan 发表于 2024-10-18 21:32:04

本帖最后由 Bella.Yuan 于 2024-10-21 10:49 编辑

您好,您参考下图测试看看。


GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(@"demo无参数1.rdlx"));
      GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(pageReport);
      reportDocument.Printer.PrinterName =@"Microsoft Print to PDF"; //@"\\xa-printer\XA-205-Lobby";//
      reportDocument.Printer.PrinterSettings.DefaultPageSettings.Margins.Bottom = 0;
      //打印指定页码
      reportDocument.Printer.PrinterSettings.FromPage = 0;
      reportDocument.Printer.PrinterSettings.ToPage = 1;
      reportDocument.Printer.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
      GrapeCity.ActiveReports.PrintExtension.Print(reportDocument, false, false);

页: [1]
查看完整版本: 如何指定打印的页码