1205983 - Exporting or printing in PDF print mode cause an "object required" JavaScript error in .NET Crystal Reports XI R2 web applications

SAP Knowledge Base Article - Public

1205983 - Exporting or printing in PDF print mode cause an "object required" JavaScript error in .NET Crystal Reports XI R2 web applications

Symptom

The JavaScript error "object required" may be thrown in a .NET web application using the Crystal Reports XI R2 components. The error occurs when clicking on the "Ok" button in the export or print dialog window.

Cause

This error is caused because the export.js file is not updated after Service Pack 2 is installed for Crystal Reports XI R2. Before Service Pack 2 the line on 105 of export.js look like this:
" document.dlgform.action = opener.document.getElementById(\"crystal_handler_page\").value;" +
 
After Service Pack 2 line 105 looks like this:
" document.dlgform.action = opener.location;" +
 
This problem could happen with custom web sites where the crystalreportviewers115 is copied into a new folder. The new folder is not updated by service or fix packs provided by Business Objects. Only the following export.js files are updated by service and fix packs:
  • Inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers115\js\export.js
  • Program Files\Business Objects\Common\3.5\crystalreportviewers115\js\export.js
  • WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\crystalreportviewers115\js\export.js

Resolution

To resolve this issue you will need to modify the export.js files on your system. The best way to do that is to search the entire C:\ drive for "export.js". There are three possible locations for the export.js files and possibly more if copies have been made.
 
  1. Right click your C:\ drive and select "Search..."
  2. Type in "export.js" and click the "Search" button
  3. Take note of all the export.js files found and only edit the ones found under crystalreportviewer115 directories.
  4. Replace line 105 in export.js that looks like this:
    " document.dlgform.action = opener.document.getElementById(\"crystal_handler_page\").value;" +
    with this:
    " document.dlgform.action = opener.location;" +
 

NOTE

It is important to only change the export.js files which are in crystalreportviewers115 directories. You may break functionality of other Crystal Reports .NET applications if you change the wrong export.js files.

Keywords

JAVASCRIPT ERROR OBJECT REQUIRED .NET NET DOTNET XI R2 SP2 SERVICE PACK EXPORT PRINT OK BUTTON WEB , 8807322 , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Bug Filed

Product

SAP Crystal Reports XI ; SAP Crystal Reports XI R2