Skip to main content

Exporting

  • 4 minutes to read

XAF allows you to export List View data and analysis data to various formats (XLS, PDF, CSV, etc.). The following View Controllers ship with the export functionality:

Export List View Data (Blazor, Windows Forms, and Web Forms Apps)

The Export Controller is designed to export List View data. If the default implementation of the Export Controller does not meet your needs, handle its events or the events of its platform-specific descendant:

The controllers mentioned above contain the Export to Action. To see examples of how to customize this Action, refer to the following topic: How to: Customize the Export Action Behavior.

The Export to Action is activated for the current List View if the List Editor supports the IExportable interface and the List Editor’s control supports the IPrintable interface. Editors that meet these criteria depend on your application platform.

Platform

List Editors that Support IExportable

ASP.NET Core Blazor

DxGridListEditor

Windows Forms

GridListEditor

PivotGridListEditor

ChartListEditor

SchedulerListEditor

TreeListEditor

ASP.NET Web Forms

ASPxGridListEditor

ASPxPivotGridListEditor

ASPxChartListEditor

ASPxTreeListEditor

When you use any of the XAF List Editors mentioned above, your application already includes the export functionality without the need to add a line of code. If you use a custom List Editor to present a List View, its data can be exported as well. To do this, make sure that this List Editor supports the IExportable interface and the editor’s control implements the IPrintable interface.

ASP.NET Core Blazor

The Export to Action exports List View data to a memory stream. This Action is only displayed in List Views whose DataAccessMode is Client and EditorType is DxGridListEditor.

The supported exported formats are:

  • CSV
  • XLS
  • XLSX

To export List View data, follow the steps below:

  1. Click Export to -> {Format_Name} File on the List View main toolbar.

    DevExpress XAF - Export ListView Data in ASP.NET Core Blazor apps

  2. The application saves the exported file to your device. The file name is the name of the exported List View.

To perform this operation, XAF uses the data-aware export that ships with the DevExpress Blazor Grid. For more information on this functionality and its limitations, refer to the following topic: Blazor Grid - Export Data.

Windows Forms

The Export to Action exports data to a file stream. The supported file formats are:

  • XLS
  • HTML
  • Text
  • MHT
  • PDF
  • RTF
  • Image

To export List View data, follow the steps below:

  1. Select File -> Export to -> {Format_Name} File from the main menu.

    Export_1

  2. Specify a file name/location and click Save.

    Export_SaveAs

    To localize the Save as type filter captions, use the Localization | OpenSaveDialogFilters node in the Model Editor.

ASP.NET Web Forms

The Export to Action exports data to a memory stream. Then, the application passes this stream to a client browser that saves it to a file. The supported file formats are:

  • XLS
  • HTML
  • Text
  • MHT
  • PDF
  • RTF
  • Image

To export List View data, follow the steps below:

  1. Select File -> Export to -> {Format_Name} File from the main menu.

    Export_Web

  2. Use the displayed dialog to open or save the exported file.

Export Analysis Data (Windows Forms and Web Forms Apps)

When you add the Pivot Chart module to your application, XAF uses one of the following Property Editors in the Analysis Detail View:

  • Windows Forms – AnalysisEditorWin
  • ASP.NET Web Forms – AnalysisEditorWeb

These Property Editors use a Pivot Grid and Chart to display data. The Export Analysis Controller is designed to export data in the same way as it is shown in these Property Editors. So, it is unlikely that you may need to customize this Controller. However, in case you have specific requirements, this Controller exposes useful events. For more information, refer to the Export Analysis Controller’s description.

The Controller contains the Export Analysis to Action and ships with the following platform-specific descendants:

  • Windows Forms – WinExportAnalysisController
  • ASP.NET Web Forms – WebExportAnalysisController

Windows Forms

The Export Analysis to Action exports analysis data to a file stream. The supported file formats are:

  • MHT
  • XLS
  • PDF
  • HTML
  • Image
  • RTF
  • Text

To export analysis data, follow the steps below:

  1. Select File -> Export Analysis to -> {Format_Name} File from the main menu.

    Export_WinExportAnalysisController

  2. Use the displayed dialog to specify an exported file’s name and location.

  3. The image below displays sample files with exported data:

    Export_WinExportAnalysisController_2

ASP.NET Web Forms

The Export Analysis Action exports analysis data to a memory stream. The supported file formats are:

  • XLS
  • HTML
  • Text
  • MHT
  • PDF
  • RTF
  • Image

To export analysis data, follow the steps below:

  1. Select File -> Export Analysis to -> {Format_Name} File from the main menu.

    Export_Web

  2. The invoked dialog allows you to open or save the exported file.