SAP Knowledge Base Article - Public

3292053 - Crystal Reports Viewer in .NET Application is blank or shows "Error"

Symptom

  • Custom .NET web application using Crystal Reports Viewer is not working, with errors such as:
    • Crystal Reports Viewer area is completely blank
    • Crystal Reports Viewer area only has the word "Error"
    • "Unable to get property 'widgetType' of undefined or null reference" when running code
    • "An Error has occurred on FileName.aspx System.TypeInitializationException: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception. --> System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for businessObjects/crystalReportViewer: Could not load file or assembly 'System, Version=14.0.4000.0, Culture=neutral, PublicKeyToken=xx' or one of its dependencies. The system cannot find the file specified. (..\web.config line 6)--> System.IO.FileNotFoundException: Could not load file or assembly ..."
  • Both versions 13 and 14 of Crystal Reports Viewer are available on the environment, or have existed at some point on the environment

Environment

One or more of the following software could be installed:

  • Crystal Reports, version for Visual Studio
  • SAP BusinessObjects BI Platform .NET SDK Runtime/Redistributable (version 14)
  • SAP Crystal Reports runtime engine for .NET (version 13)

Reproducing the Issue

  1. Have each of Crystal Reports runtime (version 13) and BI Platform runtime (version 14) installed currently, or at some point in the past.
  2. Use Crystal Reports Viewer in your web application.
  3. Face errors in attempting to view reports.

Cause

You have more than one version of the Crystal Reports viewer, which are conflicting. You either have both versions of the .NET runtime (Crystal Reports Runtime - Version 13 or SAP BusinessObjects Business Intelligence Runtime - Version 14) or had another one at some point and the viewer is still on your machine.

Resolution

If your version of Crystal Reports for Visual Studio conflicts with the version of Crystal Reports Viewer being used, you can face issues. If you have multiple versions of Crystal Reports Viewer, the incompatible one might be being used. Follow these steps to properly configure your environment:

  1. Ensure that all your SAP BI software, including runtimes, are the same version, support pack and patch.
  2. The version 13 and version 14 runtimes aren't both needed. Version 14 has all the functionalities of version 13, with additional BI Platform functionalities. So, if you have both, uninstall version 13 and keep version 14.
    1. The uninstall may not clean out the Crystal Report viewer from every location. So, check the following locations and clean them to only have version 14:
      • The application bin folder should only have version 14 .dlls
      • The GAC, located in C:\Windows\Microsoft.NET\assembly\ should only have version 14 .dlls
      • Any code, such as the web.config file, relating to runtime/Crystal Report Viewer version should be version 14.
      • For web apps, check the crystalreportviewers folder here:
        • If you're using IIS: C:\inetpub\wwwroot\aspnet_client\system_web\4_xx\
        • If you're using IIS express: C:\Windows\Microsoft.NET\Framework
      • For any kind of app, the contents of the crystalreportviewer in the following location should be the same as the crystalreportviewers14: <BO install path>\Crystal Reports\crystalreportviewer (ex. C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\Crystal Reports 2011)
  3. Whether you have both version 13 and 14, or just one version, set the right viewer in your Visual Studios project by opening your project and expand the Toolbox window.
    1. Right click on the General toolbox category and choose "Choose Items...".
    2. Scroll down to CrystalReportViewer, with the namespace CrystalDecisions.Web, there will be one for every version of Crystal Reports Viewer you have. If you uninstalled a runtime version, but its viewer still shows up here, you still have the viewer or references to it somewhere. You should clean those up per step 2.
    3. If there are no folders with the Crystal Reports viewer in it, you should right click any folder to add it in.
      1. Add/check the CrystalReportSource - CrystalDecisions.Web and CrystalReportViewer-CrystalDecisions.Web components. Click ok and check if they showed up in the Reporting tab.
    4. Only check off the viewer which is compatible with your version. Uncheck the viewer with an incompatible version.
    5. Click "Ok" and try running your application again. 

Keywords

crystalreportsviewer, crystalreportsviewer13, crystalreportsviewer14, cr for vs, bip , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

SAP Crystal Reports, version for Visual Studio all versions