I know some of you will receive strange error on Crystal Report. It is working fine on your local computer but when you hosted it, and upload it to server, it doesn’t show anything, means blank site. Hmm…. How to solve this problem? Maybe this tutorial can get help you out.

This is the story:

I had wired up a Crystal Report through a Web Form (actually embedded within an ASP.NET MVC Web Application) and loaded through the CrystalReportViewer across an ADO.NET DataSet.

All was merry on my development machine, the report loaded fine with no problems.

However, when deploying to our live server which was setup with the Crystal Reports Re-distributable Package for .NET Deployment, it was a different story.

The report was blank. Due to Crystal’s “brilliant” (cough) error reporting, I had no clue why the report failed to load other than just not seeing it.  So I decided to check the Windows Event Log for any trails (as I’ve been caught out on this before) and low and behold there was our nasty exception:

Exception type: ConfigurationErrorsException
Exception message: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS. (c:\inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers12\web.config line 6)

Well for me, creating the application as a .NET application in IIS, was not my issue, this had already been done.  The error after a bit of fiddling, I actually found out, was due to that Crystal Reports-issued Web.config mentioned in the exception (c:\inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers12\Web.config).  It was conflicting with my application.

After spending some time with this file, I couldn’t get the error message to budge.  So I took easy street, a good ‘ole rename.  I humbly decided I did not need this file after looking through the properties, there were no mission-critical properties relevant to my app in there, so click, rename, voila, report online.

Hope this was your problem.