Crystal Reports 13 JavaScript Error

Posted on Tue 22 February 2011 in ASP.NET

JSerror

Today I’d faced JavaScript bug caused by SAP Crystal Report’s js file, I Google/Bing it for one hour till I found a solution, the problem is related to this method being obsolete.

Solution

So here’s the solution I found it:

First, locate crv.js file in C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETClientFiles\crystalreportviewers13\js\crviewer then search for this code block at the bottom of the file

if(typeof(Sys)!=='undefined') {
    Sys.Application.notifyScriptLoaded();
}

And replace it with this code block

if(typeof(Sys.Application)!=='undefined') {
    Sys.Application.notifyScriptLoaded();
}

After changed this code, everything works fine now and reports shows in ASP.NET pages.

Note

Take a backup from crv.js file before editing.