Skip to main content

DocumentViewer.Export(ExportFormat, String) Method

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

Namespace: DevExpress.WinUI.DocumentViewer

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

NuGet Package: DevExpress.WinUI

Declaration

public virtual void Export(
    ExportFormat format,
    string filePath
)

Parameters

Name Type Description
format ExportFormat

The exported file’s format.

filePath String

The exported file’s full path and 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:

Export Dialog

See Also