4
votes

I have uploaded my WebApplication . My application is in VS2008 with Crystal Reports 2008 sp3. I have uploaded on parallel plex server. I have added all the Required Dll of crystal reports in the Bin folder. My report path is also correct.

The error i receive is

Line 41:         ReportDocument myreport = new ReportDocument();
Line 42:         string reportPath = Server.MapPath("~/CrystalReport.rpt");
Line 43:         myreport.Load(reportPath);
Line 44: 
Line 45:         myreport.SetDataSource(ds);


[COMException (0x800001fb): Invalid file name.]
   CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +95
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +356

[CrystalReportsException: Load report failed.]
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +418
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +895
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +84
   _Default.CreateReport() in d:\inetpub\vhosts\mydomain.in\subdomains\mysubdomain\httpdocs\Default.aspx.cs:43
   _Default.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\mydomain.in\subdomains\mysubdomain\httpdocs\Default.aspx.cs:21
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

I am not able to Get where the error is.. The report is lying in the root folder itself. so whats the issue with this. There is one another folder aspnet_client. is that anything we need to do with that ?

Kindly waiting for the reply

3
Do you get this error with this particular report or all reports ?Deb
all report .. i guess there's some issue with the permission.. but am not able to figure it out. it is working fine on my IISMoiz
Make sure Your report server (Network Service) has read write permission on C:\Windows\Temp\ folder.Deb
First! See it forum.arvixe.com/smf/general/crystal-report-problem-6893 And then do Deb said. Saludos!JD - DC TECH

3 Answers

15
votes

This same problem was headaching me for quite a while. Now i found the answer :)

Goto c:\windows\temp folder and on its properties->security Add new User "IIS_IUSRS" and give it full/ read and write ability.

It solved the problem for me.

Hope it does for you too :)

4
votes

Here is something to check.

You are getting this error because either the file name,path is invalid or CR can not access the file.

If the path and file name are ok then you need to make sure Network Service has read/Write permission to your Temp folder (Generally C:\windows\Temp).

If it still does not resolve the issue then perhaps your Temp folder is full and CR is not cleaning the garbage.

If this is the case then you need to make sure you are duly Disposing your Report object and calling the GC to clean it up.

Some times CR behaves unpredictably. I have learnt this in a hard way that even though you call dispose on your ReportDocument object followed by GC.Collect() still the .rpt files in Temp folder are not cleaned up. And there is a limit to no. of .rpt files in a Temp folder after which CR stops executing further report requests.

Strangely this happens when you declare your ReportDocument object in side a function or event handler. But if you declare your ReportDocument in a page wide global scope then crystal reports happily cleans of temp .rpt files when you call the Dispose method !!

I hope this will give you some insight in fixing the issue.

0
votes

Something to also check is that all the appropriate IIS role services had been added on the server. We picked up this same issue on a newly installed production server, but not on our local development environments. Turns out, IIS was added as a server role, but the ASP.NET & Server-side Includes were not added as role services & thus the Crystal Report Viewer didn't render any reports.

If you are running Windows Server 2008, you can manage these roles & role services through the Server Manager tool.