I have created a devexpress XtraReport file in my wpf application. Loaded the data into the report using custom Sql Query in Report wizard. How can i display the report on button click in a xaml usercontrol screen?
Currently i am trying to display as below :
private void GenerateZBReport_Click(object sender, RoutedEventArgs e)
{
XtraReport report = new XtraReport();
DocumentPreviewWindow window = new DocumentPreviewWindow();
window.PreviewControl.DocumentSource = report;
report.CreateDocument(true);
window.ShowDialog();
}
Use the DocumentPreviewControl located in a UserControl or Window. This is especially helpful in case you want to customize the preview control. This functionality is described in the following help file: Create a Custom Document Preview. Otherwise you can use the PrintHelper class: Invoke a Default Document Preview.