user2505035
user2505035

Reputation: 11

Crystal Report Works with IIS Epress but not with Local IIS

I have an ASP.Net MVC solution (Visual Studio 2015 - C# - Windows 8 x64 bit) and I am trying to export a crystal report to pdf. If I apply IIS Express to my project, then I can export successfully the report to pdf .

But when I change it to Local IIS and run the same code

reportDocument.ExportToStream(ExportFormatType.PortableDocFormat)

I get the error below :

System.Runtime.InteropServices.COMException: The system cannot find the path specified.

I googled it and found that it may be an authentication error, so I added the "IIS AppPool\DefaultAppPool" user to the security section of the folder that contains the Crystal Report files. But the problem remains..

Do you have any workaround about this?

UPDATE: I get this error when I try to export a report that requires input parameters (from C#). The reports that require no params are exported successfully!!

Upvotes: 1

Views: 1966

Answers (2)

Bohden M
Bohden M

Reputation: 84

It's possible that you're working with the 32-bit runtime of CR.

If that's the case, you can go into IIS > ApplciationPools, and go into the Advanced Settings of whichever pool your MVC application is running in. There is a row for "Enable 32 bit Applications" which is set to NO by default.Changing this to YES will make the COM objects/libraries accessible.

Upvotes: 1

Dylan
Dylan

Reputation: 1118

Did you set the report in Visual Studio to Copy if Newer or Copy Always like shown below? It sounds like your report is not there. If not set it to that and rebuild and publish it again.

enter image description here

Upvotes: 0

Related Questions