SAP Knowledge Base Article - Public

2062628 - WPF Viewer - Exporting to a locked file throws exception


WPF Viewer - Exporting to a locked file, Excel for example, throws an Exception. No way to trap the exception.


Crystal Reports for Visual Studio

Reproducing the Issue

  1. Create a simple WPF viewer app in CR for VS SP 10.
  2. Open any report with data and hit the export button and export to Excel.
  3. Open the file in Excel, leave it open in Excel.
  4. Export again to the same file and you do get prompted indicating it already exists but click OK any ways.

Exception is thrown:

"Value cannot be null.\r\nParameter name: window"

It should not throw exception and message should say: "Error: .... because it is being used by another process."


This issue has been tracked and escalated.

Set for Service Pack 12.

See this link for updates and notes:



WPF, CR for VS, Crystal Reports for Visual Studio, VS, visual studio, export, exception, file lock , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem


SAP Crystal Reports, developer version for Microsoft Visual Studio