Back to Devexpress

PrintControl.DisableExportModeValues(Object[]) Method

windowsforms-devexpress-dot-xtraprinting-dot-control-dot-printcontrol-dot-disableexportmodevalues-x28-system-dot-object-x29.md

latest3.5 KB
Original Source

PrintControl.DisableExportModeValues(Object[]) Method

Removes the specified export modes from the list of export options available in Print Preview.

Namespace : DevExpress.XtraPrinting.Control

Assembly : DevExpress.XtraPrinting.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
public void DisableExportModeValues(
    object[] disableValues
)
vb
Public Sub DisableExportModeValues(
    disableValues As Object()
)

Parameters

NameTypeDescription
disableValuesObject[]

An array of export modes to remove.

|

Remarks

Use the DisableExportModeValues method to prevent the use of any of the following export modes:

Example

This example illustrates how to disable some of the export modes for export formats available in Print Preview.

csharp
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
//...

// Create a report instance and assign it to a Print Preview.
XtraReport report = new XtraReport1();
ReportPrintTool preview = new ReportPrintTool(report);

// Select the export modes to be disabled.
Object[] disabledExportModes = new Object[2] { RtfExportMode.SingleFile, XlsxExportMode.DifferentFiles };

// Disable the selected export modes.
preview.PreviewForm.PrintControl.DisableExportModeValues(disabledExportModes);

// Show the Print Preview form.
preview.ShowPreviewDialog();
vb
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraReports.UI;
' ... 

' Create a report instance and assign it to a Print Preview.
Dim report As XtraReport = New XtraReport1()
Dim preview As New ReportPrintTool(report)

' Select the export modes to be disabled.
Dim disabledExportModes As Object = New [Object](1) {RtfExportMode.SingleFile, XlsxExportMode.DifferentFiles}

' Disable the selected export modes.
preview.PreviewForm.PrintControl.DisableExportModeValues(disabledExportModes)

' Show the Print Preview form.
preview.ShowPreviewDialog()

See Also

Document Export Overview

PrintControl Class

PrintControl Members

DevExpress.XtraPrinting.Control Namespace