本帖最后由 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);
|