I recently came across an unusual error when attempting to load a crystal report form into my WPF application via a dialog, the report would show as loading for a few seconds and then throw an error stating "Value cannot be null. Parameter name: window"
This confused me, as far as i know, crystal reports doesn't use a parameter named window.
This was my code:
A simple window with a CrystalReportsViewer
<Window x:Class="Client.Views.ReportsWindowView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:SAPBusinessObjects.WPF.Viewer;assembly=SAPBusinessObjects.WPF.Viewer"
Title="ReportsWindowView" Height="300" Width="300" Loaded="Window_Loaded">
<Grid>
<my:CrystalReportsViewer ShowOpenFileButton="True" Grid.Column="1" x:Name="ReportView"/>
</Grid>
and loading the report from code behind (I've removed the standard ConnectionInfo code for simplicity)
cryRpt = new ReportDocument();
cryRpt.Load("report.rpt");
ReportView.ViewerCore.ReportSource = cryRpt;