这个问题官网一直都没有解决,反复强调说只有转成PDF才是最好的结局方法,官方给出了个半自动的解决方案,各位可以参考一下。
protected void Button1_Click(object sender, EventArgs e) { FastReport.Utils.Config.WebMode = true; using (Report report = new Report()) { report.Load("your_report.frx"); report.RegisterData(...); report.Prepare(); // Export report to PDF stream FastReport.Export.Pdf.PDFExport pdfExport = new FastReport.Export.Pdf.PDFExport(); using (MemoryStream strm = new MemoryStream()) { report.Export(pdfExport, strm); // Stream the PDF back to the client as an attachment Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; Response.ContentType = "Application/PDF"; Response.AddHeader("Content-Disposition", "attachment;filename=report.pdf"); strm.Position = 0; strm.WriteTo(Response.OutputStream); Response.End(); } } }
FastReport ASP.Net包括在FastReport.Net里面,有兴趣的可以点这里下载~