Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Runtime.InteropServices.COMException: Invalid file name in Crystal Report

I am using Visual Studio 2010 with Crystal Report. It is working fine in my local server but on web server, it is giving error : System.Runtime.InteropServices.COMException: Invalid file name.

I tried many solutions like put .rpt file in any folder and provide that path, give full permission to windows temp folder, enable parent path form IIS etc.

But none of them is working. Please help me to solve this.

My current path :

crystalReport.Load(Server.MapPath("~/PurchaseOrder1.rpt"));


Crystal Report error

like image 267
Jeeten Parmar Avatar asked Oct 31 '22 05:10

Jeeten Parmar


1 Answers

Not a whole answer but I'm too new to SO just to comment. One thing you could try is to download Process Monitor and watch to see where Crystal is trying to load the file from and that may help. Process Monitor will give a lot of output but that can be filtered on, for instance, part of the filename. It may tell you if there is a permissions issue too. I find it very useful for these sort of situations where you can't work out why a file is not found.

like image 78
OldBoyCoder Avatar answered Nov 15 '22 04:11

OldBoyCoder