Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
5.00/5 (4 votes)
See more: , +
Here's the scenario:

Windows Server 2003 SP2
Hosting ASP.NET web application Framework 4.0 that uses Crystal reports Viewer to render Crystal Reports Version=13.0.2000.0

Yes, I have installed Crystal Reports Runtime Engine for .NET Framework 4 (32-bit)

I can see that all of my crystal reports render just fine when accessing the web application locally (http://localhost/myApp.aspx), but when I access the application from outside of the network, my crystal report viewer will not render the crystal reports. I do not get an exception, it just doesn't render. I have deployed this exact same web application to other servers (including Windows Server 2003) without a hitch. I am at the end of my rope and out of ideas. I have tried everything under the sun regarding permissions to the virtual directory, uninstalling and reinstalling CR Runtime, etc). Of course, I've scoured the web, maybe left the right stone unturned, you know the drill.

Help me, codeproject friends, you're my only hope...

Update: 11/22/2011: When I browse the application from within IIS, I get the following error:

'Sys.Application' is null or not an object

URL http://localhost/aspnet_client/system_web/4_0_30319/crystalreportviewers13/crviewer/crv.js
Posted
Updated 22-Nov-11 7:45am
v3

When you are adding Ajax Toolkit components to your website, like DLLs and the actual controls and it compiles ok but when you render the page you get no action and a javascript error. To resolve it, you need to add references at httpHandlers section in web.config.
XML
<httpHandlers>
 <remove verb="*" path="*.asmx"/>
 <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
 <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
 <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
 
Share this answer
 
Comments
jasonHall 30-Nov-11 13:09pm    
Unfortunately, this modification did not resolve the javascript error, nor did it help with my crystal reports viewer issue. I should note that I only see the javascript error when browsing the web application from IIS via the browse option. Again, the Crystal report viewer renders the reports fine when accessed locally, but from outside the network, the crystal reports do not render. This has to be some sort of network issue, right?
Still If you have a problem with this issue:

1. Open the the page that the empty report renders from your browser. Find console errors using dev. tool of your browser (f12)

2. You will see that some of the scripts and css related with crystal reports does not exists under the correct folders.

For example: crystal reports looking for v4.XX81 but you have v4.xx79 on hand. Than make clone of that folder and rename v4.XX81
 
Share this answer
 
Comments
Daniel Pel 20-Aug-18 1:45am    
Thaaank you!
After a lot of headaches, I was able to resolve this issue. This is what I did and how I got the issue resolved.



I installed this same .NET web application on another Windows 2008 Small Business. I did it a little differently this time, though. Instead of using the default web site in IIS for the creation of a virtual directory, I had to use the Create Web Site Wizard in IIS to generate a new database. I chose framework 4 integrated application pool, btw. I browsed to the application and once again, the crystal report viewer would not work.



Some other forum threads suggested changing your web.config and essentially telling the assembly where to find the crystalreportviewer13 runtime engine support files. This is what clued me into what exactly is going on. The crystal report viewer doesn't know how to render with out these script files, css files, etc. If it can't find the path to these files, it can't render the crystal report viewer. How I understand it is the crystal report viewer is dependent upon the runtime engine installation files for .NET Framework 4 (32 & 64 bit installs). These assembly files don't get included in your .NET project. I think that is a HUGE oversight by Visual Studio --- why not include ALL files required to run your object!?!? Sorry, anyway, here's all I did:



1) Go to the C\inetpub\wwwroot folder on any machine that has either/or crystal report runtime engine installations. For my purposes, I just went to the one on the 2008 server I'm installing on.

2) Copy the aspnet_client folder in the wwwroot directory.

3) Paste this folder in the website directory folder. I assume this would work with a web application that was created from a virtual directory as well, just paste it into the virtual directory.



You may be able to avoid this by creating all of the necessary folders and sub folders, then copying over each file into your web application project on your development machine, in order to include them in your published, complied web application. If this is confusing, just perform the steps above in the deployment environment.

Here's my forum post on SAP:
 
Share this answer
 
v2
Comments
adetunji Sunmonu 30-Jan-13 6:56am    
Thank you. The method above worked like magic. God Bless u
jasonHall 13-Feb-13 10:09am    
You're welcome! I've noticed a ton of forum posts regarding this issue. I hope more people find this thread, because I've never had the problem again. I ended up actually including the aspnet_client folder (created by the CR Runtime.msi) in my project/solution folder, so that it would deploy with the project every time. I never had to worry about this issue again.
jha2 6-Mar-13 5:40am    
wOw Thank you man.. it works like a charm :) God Bless you
s.amittyagi 22-May-13 2:39am    
thanks for share
HackensackNJ 24-Jun-13 6:53am    
Works like charm. Thanks for sharing. Did you email Ludek (SAP CR programmer)? You should tell him since his solutions to the problem is so much more complicated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900