ssrs报告错误"本地报告处理期间发生错误。"

时间:2017-03-01 08:18:07

标签: c# asp.net-web-api ssrs-2008

我想将rdl导出到pdf,并且报告中包含查询和数据集在报告中设置的所有内容。我正在使用此代码,但它给了我一个错误

ReportViewer reportViewer = new ReportViewer();
reportViewer.ProcessingMode = ProcessingMode.Local;
reportViewer.SizeToReportContent = true;
reportViewer.Width = Unit.Percentage(900);
reportViewer.Height = Unit.Percentage(900);
string filePath = HttpContext.Current.Server.MapPath(@"~/Reports/Reports.rdl");
reportViewer.LocalReport.ReportPath = HttpContext.Current.Server.MapPath(@"~/Reports/Reports.rdl");

Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string filenameExtension;

byte[] bytes = reportViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings);

using (FileStream fs = new FileStream(filePath, FileMode.Create))
 {
   fs.Write(bytes, 0, bytes.Length);
 }

请帮我解决这个问题..?

0 个答案:

没有答案