I’m using C# WPF application to display crystal reports and i want to call a function when crystal report viewer refresh button is clicked.
so in viewer properties i set command binding to refresh and application XAML looks like below
<Grid>
<cr:CrystalReportsViewer Name="reportViewer">
<cr:CrystalReportsViewer.CommandBindings>
<CommandBinding Command="NavigationCommands.Refresh"/>
</cr:CrystalReportsViewer.CommandBindings>
</cr:CrystalReportsViewer>
</Grid>
any idea how to capture this refresh event and call the command handler?
Regards
cr:CrystalReportVieweris not a WPF control; therefore it has noCommandBindingsproperty.In order to be notified when the Refresh button was clicked, you could proceed as follows:
XAML:
Code-behind:
Your code-behind must include
You need to add references to
WindowsFormIntegration,CrystalDecisions.Windows.Forms, andCrystalDecisions.CrystalReports.Engineto your Visual Studio project.