我正面临.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}}