The requested page is not available for the requested platform. You are viewing the content for Default platform.

WinReportServiceController.CustomShowPreview Event

Occurs before showing the report's Preview dialog.

Namespace: DevExpress.ExpressApp.Reports.Win

Assembly: DevExpress.ExpressApp.Reports.Win.v19.1.dll


public event EventHandler<CustomShowPreviewEventArgs> CustomShowPreview
Public Event CustomShowPreview As EventHandler(Of CustomShowPreviewEventArgs)

Event Data

The CustomShowPreview event handler receives an argument of the DevExpress.ExpressApp.Reports.Win.CustomShowPreviewEventArgs type.


Handle the CustomShowPreview event to implement a custom logic to be executed before, or instead of, displaying the Preview dialog. You can access the report via the handler's Report parameter. Additionally, you can access the PrintTool object, to modify the printing options. Set the handler's Handled parameter to suppress the default Report Wizard.

using DevExpress.XtraReports.UI;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Reports.Win;
// ...
public class ConfigurePrintingSystemViewController : ViewController {
    private WinReportServiceController reportService;
    protected override void OnActivated() {
        reportService = Frame.GetController<WinReportServiceController>();
        if (reportService != null) {
            reportService.CustomShowPreview += reportService_CustomShowPreview;
    private void reportService_CustomShowPreview(
        object sender, CustomShowPreviewEventArgs e) {
        e.PrintTool.PrintingSystem.ExportOptions.PrintPreview.ShowOptionsBeforeExport = false;
        e.Handled = true;
    protected override void OnDeactivating() {
        if (reportService != null)
            reportService.CustomShowPreview -= reportService_CustomShowPreview;

The ShowPreviewDialog method is an extension method implemented in the DevExpress.XtraPrinting.v19.1.dll assembly. A reference to this assembly is required to compile the code above.

Refer to the How to: Customize Export Options of the Printing System topic, to see another example of using the CustomShowPreview event.

See Also