Crystal Report "Invalid file name." question

I downloaded my WebApplication. My application is in VS2008 with Crystal Reports 2008 sp3. I uploaded to the plex parallel server. I added all the necessary Crystal Reports reports to the Bin folder. My report path is also correct.

The error I get 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 can not get where the error is. The report lies in the root folder itself. so the problem is with that. There is another aspnet_client folder. What is all we need to do with this?

waiting for an answer

+4
source share
3 answers

The same problem pounded me for a long time. Now I found the answer :)

Go to the folder c:\windows\temp and on properties->security Add a new user " IIS_IUSRS " and give him the opportunity to completely / read and write.

He solved the problem for me.

Hope this is for you too :)

+13
source

Here's a check.

You get this error, because either the file name , the path is invalid, or CR cannot access the file.

If the path and file name are ok, you need to make sure the Network Service has read / write to the Temp folder (usually C:\windows\Temp ).

If the problem is still not resolved, your Temp folder may be full and CR will not clear the garbage.

If so, you need to make sure that you properly repair the report object and call the GC to clean it.

Several times, CR behaves unpredictably. I learned it with difficulty, but even if you call the ReportDocument object, followed by GC.Collect() , and the .rpt files in the Temp folder are not cleared. And there is no limit. .rpt files in the Temp folder, after which CR stops performing further report requests.

This happens strangely when you declare your ReportDocument object as a function or event handler. But if you declare your ReportDocument in a global global scope , then crystal reports will happily clean up temporary .rpt files when you call Dispose !!

I hope this gives you some insight into fixing the problem.

+3
source

Something to verify that all relevant IIS role services have been added to the server. We raised the same issue on a newly installed production server, but not on our local development environments. It turns out that IIS was added as a server role, but ASP.NET and server components were not added in the role services role, so Crystal Report Viewer did not produce any reports.

If you are using Windows Server 2008, you can manage these roles and role services using the Server Manager tool.

0
source

Source: https://habr.com/ru/post/1247588/


All Articles