繁体   English   中英

Microsoft报告rdlc性能问题导出到pdf

[英]Microsoft reporting rdlc performance issues exporting to pdf

我正在使用Microsoft.Reporting.WebForms生成pdf文件,但是即使创建一个简单的文件也花费了太长时间,到目前为止,我试图创建一个带有参数“名称”和文本框来呈现它的简单报告,仅此而已大约需要4秒钟,希望您对此问题有所帮助,这是示例代码:

public byte[] GenerateReport(string name)
{
   var report = new LocalReport();
   var deviceInfo = string.Format(@"<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>", "pdf");
   report.ReportEmbeddedResource = "namespace.TestReport.rdlc"
   report.SetParameters(new ReportParameter("Name", name));
   return report.Render("pdf", deviceInfo);
}

运行大约需要4秒钟,我的报告稍微复杂一些,花费了6秒钟多一点,谢谢

请尝试这些...

reportViewer.LocalReport.ReportPath = "Report1.rdlc";
reportViewer.LocalReport.ExecuteReportInCurrentAppDomain(
      Assembly.GetExecutingAssembly().Evidence);
reportViewer.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("Contoso.Utilities, 
      Version=1.0.271.0, Culture=neutral, PublicKeyToken=89012dab8080cc90");

如提供

http://msdn.microsoft.com/zh-CN/library/microsoft.reporting.winforms.localreport.executereportincurrentappdomain(v=vs.100).aspx

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM