Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Collapse]Build an Application
  [Expand]Choose Application UI
   Data Management Controls
  [Collapse]Printing and Exporting
    How to: Preview XtraGrid Control
    How to: Customize Print Appearances
    How to: Set Paper Format and Add Custom Information to the Report when Printing/Exporting a Control
    Printing Basics
    Printing Options
    Print Appearances
    Export a Control in Various Formats (PDF, HTML, BMP, etc.) Using the XtraPrinting Library
  [Expand]WinForms MVVM
  [Expand]Skins
  [Expand]Localization
  [Expand]Right-to-Left Layout
   Redistribution and Deployment
 [Expand]Controls and Libraries
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Set Paper Format and Add Custom Information to the Report when Printing/Exporting a Control

DevExpress Reporting controls for WinForms allow you to customize paper format, orientation, and add custom information to a report. Note that the following approach applies to controls that implement the IPrintable interface (e.g. XtraGrid, XtraPivotGrid, XtraScheduler, XtraTreeList, XtraCharts, Layout Control, XtraVerticalGrid, etc.).

This document consists of the following sections.

To get started with this tutorial, start Microsoft Visual Studio and create a new Windows Forms Application or open an existing one. Then, run the Toolbox and drop the required control that implements the IPrintable interface onto the form.

Next, you can bind the control to data or populate it manually.

Expanded Customize Print Options at Runtime

The IPrintable interface allows you to customize print settings and print a control using a PrintableComponentLink. The following code demonstrates how to create a PrintableComponentLink, assign a control to its PrintableComponentLinkBase.Component property, adjust its print settings, and print the control.

Expanded Add Custom Information to a Report at Runtime

Create a report header or footer to add custom information to a report. Subscribe to the CreateReportHeader event to add a report header, as shown below.

Handle the CreateReportHeader event as follows.

The following image illustrates a resulting report contains with the specified print options and additional custom information.

Expanded Export a Report to the Specified Format at Runtime

In addition to the export functionality provided in the Print Preview window, you can also export a report via the PrintableComponentLink object.

Expanded See Also

How would you rate this topic?​​​​​​​