Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I am currently working on project of Purchase, I am using Visual Studio-2010 and SAP-Crystal Report for Visual Studio - 2010 for Crystal Report , I am using ASP.Net 4.0 for this website.

When i made the code,it was working fine when i run it from visual studio and seems everything fine.

But when i hosted the code on my local machine's IIS and when i visit the link the Crystal Report doesn't works it says :"Load Report Failed", i tried searching many things, i tried emptying C:\windows\temp folder , i also tried using the below code:
C#
public static ReportDocument rep = new ReportDocument();
   protected void Page_UnLoad(object sender, EventArgs e)
   {
       this.CrystalReportViewer1.Dispose();
       this.CrystalReportViewer1 = null;
       rep.Close();
       rep.Dispose();
       GC.Collect();
   }

but i am not able to solve the error . Please help me out in resolving the error.
I am really stucked up.

Thanks in advance,
Regards,
Krunal Panchal
Posted
Updated 21-Jul-11 20:36pm
v2

Make sure the program can find the crystal report and its path is recognizable by it.
 
Share this answer
 
Comments
[no name] 22-Jul-11 2:53am    
Hi,
I have written code like this:
ReportDocument rep = new ReportDocument();
rep.Load(Convert.ToString(Server.MapPath("~/rptMRNEntry.rpt")));
rep.SetDataSource(ds.Tables[0]);
CrystalReportViewer1.ReportSource = rep;

It could find the report when i run it from visual studio but not able to see the report when browsed from IIS.

Please help me out.

Regards,
Krunal Panchal
try to locate the reports file under bin folder.
Load(bin/.../Reports.rpt)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900