无法在Windows Server 2012中将报表呈现为PDF

时间:2016-03-24 17:22:32

标签: c# wpf winforms pdf rdlc

我正面临.NET中最奇怪的技术问题之一。我已经编写了以下逻辑来将报告导出到PDF,该systems除了Windows Server 2012以外的所有Microsoft.ReportViewer.Winforms.dll。可能是什么问题呢?我尝试使用最新的reportViewer = new ReportViewer(); Warning[] warnings; string[] streamids; string mimeType, encoding, filenameExtension; Assembly assembly = Assembly.LoadFrom(report.AssemblyName); Stream stream = assembly.GetManifestResourceStream(report.ReportName); reportViewer.LocalReport.LoadReportDefinition(stream); //reportViewer.LocalReport.DataSources.Clear(); //reportViewer.ProcessingMode = ProcessingMode.Local; //lr = reportViewer.LocalReport; //lr.ReportPath = "Reports\\CommentReport.rdlc"; reportViewer.LocalReport.DataSources.Clear(); foreach (var dataSource in report.DataSources) { reportViewer.LocalReport.DataSources.Add(new ReportDataSource(dataSource.Key, dataSource.Value)); } pdfByteArray = reportViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings); ,但这也没有帮助。如果有人有任何想法可以解决这个问题,请帮助我。

{{1}}

0 个答案:

没有答案