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

DashboardViewer.PrintPreviewShowing Event

Allows you to customize the Print Preview window at runtime.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v19.1.Win.dll

Declaration

public event PrintPreviewShowingEventHandler PrintPreviewShowing
Public Event PrintPreviewShowing As PrintPreviewShowingEventHandler

Event Data

The PrintPreviewShowing event handler receives an argument of the PrintPreviewShowingEventArgs type. The following properties provide information specific to this event.

Property Description
RibbonPreview Gets the Print Preview with a ribbon toolbar.
StandardPreview Gets the Print Preview with a standard toolbar.

Remarks

The PrintPreviewShowing event is raised before the Print Preview window is invoked, and allows you to customize the Print Preview window and the displayed document.

The Print Preview window provides two toolbar types and can be invoked in two ways.

The following event parameters allow you to customize the Print Preview depending in the used toolbar.

Important

Note that you can customize the exported document by handling the DashboardViewer.CustomExport event.

Examples

The code snippet below shows how to access the underlying report when handling the DashboardViewer.PrintPreviewShowing event.

using DevExpress.DashboardWin;

        // ...
        private void dashboardViewer1_PrintPreviewShowing(object sender, PrintPreviewShowingEventArgs e) {
            PrintingSystemBase ps = e.RibbonPreview.PrintControl.PrintingSystem;
            ps.SetCommandVisibility(PrintingSystemCommand.ExportXlsx, CommandVisibility.All);
            ps.SetCommandVisibility(PrintingSystemCommand.SendXlsx, CommandVisibility.All);

            ps.SetCommandVisibility(PrintingSystemCommand.Save, CommandVisibility.None);
            ps.SetCommandVisibility(PrintingSystemCommand.Open, CommandVisibility.None);
        }
See Also