Skip to main content

DocumentViewer.Export(ExportFormats, String) Method

Exports the document with the specified name, path, and file format.

Namespace: DevExpress.WinUI.DocumentViewer

Assembly: DevExpress.WinUI.DocumentViewer.v21.2.dll

Declaration

public virtual void Export(
    ExportFormats format,
    string filePath
)

Parameters

Name Type Description
format ExportFormats

The exported file’s format.

filePath String

The exported file’s full path and the name.

Remarks

The following code sample exports the opened document as a CSV file to the specified path:

<Window ...
    xmlns:dxdvr="using:DevExpress.WinUI.DocumentViewer">
    <StackPanel Orientation="Vertical">
        <dxdvr:DocumentViewer x:Name="documentviewer" DocumentSource="ms-appx:///data/Invoice.prnx" Height="700" />
        <Button Content="Export Report" Click="Button_Click"/>
    </StackPanel>
</Window>
using DevExpress.WinUI.DocumentViewer;

// ...
private void Button_Click(object sender, RoutedEventArgs e) {
    documentviewer.Export(ExportFormats.Csv ,"C:\\Users\\user\\Documents\\Report.csv");
}

Open Export Dialog

You can use the ShowExportDialogCommand or click the Export button in the UI to open the Export dialog.

See Also