您好,您用的是区域报表。我也看了您的打印代码。
您换一种打印的方式试试。用这种打印的写法:GrapeCity.ActiveReports.PrintExtension.Print(sectionDocument, true, true);- GrapeCity.ActiveReports.SectionReport rpt = new GrapeCity.ActiveReports.SectionReport();
- System.Xml.XmlTextReader xtr = new System.Xml.XmlTextReader(Server.MapPath("~") + @"\Upload\Style\Default.rpx"); //Invoice
- rpt.LoadLayout(xtr);
- xtr.Close();
- try
- {
- rpt.DataSource = BuildData();
- rpt.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4;
- rpt.Run(false);
- }
- catch (Exception ex)
- {
- Response.Write("error: " + ex.StackTrace);
- }
- GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport pdf = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport();
- MemoryStream ms = new System.IO.MemoryStream();
- pdf.Export(rpt.Document, ms);
- // Microsoft XPS Document Writer 本地默认XPS打印机
- rpt.Document.Printer.PrinterName = fPrintDocument.PrinterSettings.PrinterName;
- //result = rpt.Document.Print(false, false); //执行打印
- GrapeCity.ActiveReports.PrintExtension.Print(rpt.Document, false, false);
复制代码
|