The exporting system allows you to export List Views. This topic describes the basics of using this system in WinForms and ASP.NET applications. Mobile applications do not support this functionality.
Exporting is provided by the following ViewControllers:
The Export Controller is designed to export List View data. It contains the Export Action. There are two descendants for this Controller: WinExportController for Windows Forms application and WebExportController for ASP.NET applications. In the WinExportController, the Export Action exports data to a file stream. So, the Save File Dialog is invoked before exporting.
To localize the Save as type filter captions in the Save File Dialog, use the Localization | OpenSaveDialogFilters node in the Model Editor.
In the WebExportContoller, the Export Action exports data to a memory stream, which is then passed to a client browser to be saved to a file.
The Export 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. Currently, all the built-in Windows Forms List Editors and most ASP.NET List Editors implement the IExportable interface, and only printable controls are used. So, when using XAF List Editors, the exporting is included in your applications without a line of code. At the same time, if you use a custom List Editor to present a List View, it will be exported as well, if you support the IExportable interface and use a control that implements the IPrintable interface.
If the default implementation of the Export Controller doesn't meet your needs, handle its events or the events of the descendants. To see examples of the Export Action customization, refer to the How to: Customize the Export Action Behavior topic. Get more information on the Export Controller and its descendants in the Reference help section.
When you add the Pivot Chart module to your application, the AnalysisEditorWin and AnalysisEditorWeb Property Editors are used in the Analysis Detail View. These Property Editors represent data via a Pivot Grid and Chart. To export data in the way it is presented by these Property Editors, the Export Analysis Controller is designed. This Controller contains the Export Analysis Action.
There is a Windows Forms-specific WinExportAnalysisController, which is the Export Analysis Controller's descendant. It creates a file stream to export data. So, the Save File Dialog is invoked before export.
The ASP.NET-specific WebExportAnalysisController, the Export Controller's descendant, creates a memory stream to export data.
The Export Analysis Controller is designed specially for the Analysis Detail View represented by Property Editors from the Pivot Chart module. So it is unlikely that you may need to customize this Controller. However, in case you have specific requirements, this Controller exposes useful events. Refer to the Reference help section to learn more about the Export Analysis Controller.