load report failed

半腔热情 提交于 2019-12-25 12:38:07

问题


Load report failed this error logged when i try to open Crystal report and if i restart my iis (iisreset) then it's working.

Here's my code:

Dim objReport As New CrystalDecisions.CrystalReports.Engine.ReportClass
Dim location As String = context.Server.MapPath("../POC/POC1.rpt")
objReport.FileName = location
objReport.Load()
objReport.SetDataSource(dsPOC)

What could be the problem?


回答1:


Try this...it will give you the perfect idea....

using System;using CrystalDecisions.CrystalReports.Engine;using CrystalDecisions.Shared;namespace Report
 {       public partial class Report : Document    
  {       public void ReportLoad()    
   {             ReportDocument reportDocument = new ReportDocument();       
 string filePath = "C:\Projects\Application\Report\CrystalReport.rpt";            reportDocument.Load(filePath);  
          crystalReportViewer.ReportSource = reportDocument; 
      }   
}}  



回答2:


Thanks for your response. Now the problem solved by objReport.Dispose(). I called this Dispose Method after appending each document. The problem might be i failed to release data form memory.

regards, saj



来源:https://stackoverflow.com/questions/5138956/load-report-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!