[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Deployment
 [Collapse]Task-Based Help
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]Actions
  [Expand]Navigation
  [Expand]Views
  [Expand]List Editors
  [Expand]Property Editors
  [Expand]Templates
  [Expand]Filtering
  [Expand]Reporting
  [Expand]Dashboards
  [Expand]Scheduler and Notifications
  [Expand]Maps
  [Expand]Security
  [Expand]Workflow
  [Expand]Localization
  [Expand]Testing
  [Collapse]Miscellaneous UI Customizations
    How to: Add a Button to a Detail View Using Custom View Item
    How to: Add an XAF Mobile Custom Module
    How to: Adjust the Size and Style of Pop-up Dialogs (ASP.NET)
    How to: Adjust the Windows' Size and Style
    How to: Change an Application Logo and Info
    How to: Create a Custom Control Detail Item
    How to: Customize a Window Caption
    How to: Customize ASP.NET Layout Elements Using Custom CSS Classes
    How to: Customize Export Options of the Printing System
    How to: Customize the Conditional Appearance Module Behavior
    How to: Customize Window Status Messages (WinForms)
    How to: Enable High DPI Support in a WinForms Application
    How to: Implement a Custom Messaging Class
    How to: Implement Client-Side Logic in Mobile Applications
    How to: Include an Action to a Detail View Layout
    How to: Raise XAF Callbacks from Client-Side Events and Process these Callbacks on Server
    How to: Set Images and Captions for Enumeration Values
    How to: Show a Custom Window with an Embedded XAF View
    How to: Show a Custom Windows Form
    How to: Use a Custom Plugin in a Mobile Application
    How to: Use a Custom Splash Screen
    How to: Use a DevExtreme Chart in a Mobile Application
    How to: Use Custom Themes in ASP.NET Applications
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Customize Export Options of the Printing System

In a Windows Forms XAF application, end-users have an ability to export View print previews to various formats. Before exporting, an Export Options dialog is invoked. The format-specific options can be changed using this dialog, for example, the HTML title or XLS sheet name.

Tip

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E2108.

Note

To learn how to specify export options for reports, refer to the How to: Customize the Report Export Options topic.

  • The PrintingControllerController, supplied with the System module, exposes the PrintingController.PrintingSettingsLoaded event. You can handle this event to access the PrintingSystem object and modify default export options. To do this, implement the following View Controller:

    Note

    The ShowPreviewDialog method is an extension method implemented in the DevExpress.XtraPrinting.v18.2.dll assembly. A reference to this assembly is required to compile the code above.

    You can access various export options in the ConfigurePrintingSystem, SetXlsOptions, SetPdfOptions, SetHtmlOptions and SetGeneralOptions methods. The following classes provide the available properties:

    Note

    You can implement additional methods for other export formats, and call them from the ConfigurePrintingSystem method.

  • Run the Windows Forms application. Execute the PrintPreview Action in any View. In the invoked Preview dialog, click File | Export Document... and select the export format. You will see that the default export settings are changed (modified settings are highlighted in the screenshot).

    The default file name in the Save As dialog is also changed to "CustomFileName"

  • If it is required to disable the Export Options dialog and always use the default options, add the following code to the SetGeneralOptions method:

Expanded See Also

Is this topic helpful?​​​​​​​