Crystal Report “Invalid file name.” issue

。_饼干妹妹 提交于 2019-12-05 14:21:07

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 :)

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.

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.

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