SAP Knowledge Base Article - Public

1544651 - Crystal Reports WPF Viewer fails with NullReferenceException when used in a WinForms application

Symptom

  • WinForms that references a WPF control library
  • Attempt to show the window with the CR WPF viewer results in the following exception

Object reference not set to an instance of an object

Environment

Reproducing the Issue

  • Create a WinForm application that references a WPF control library
  • Encapsulates the new Crystal Reports WPF Viewer
  • Run the application

Cause

  • Hosting the WPF viewer in a WinForm app was not considered and therefore not tested
  • The CR WPF viewer uses specific WPF Framework APIs that do not work in WinForms

Resolution

Keywords

KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Product Enhancement

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio