Back to Devexpress

WindowControlOptions.PrintMode Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-windowcontroloptions-2347809e.md

latest6.5 KB
Original Source

WindowControlOptions.PrintMode Property

Gets or sets whether to print a control inside the PrintableComponentContainer as a Printing System brick or as an image.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[DefaultValue(WinControlPrintMode.Default)]
public WinControlPrintMode PrintMode { get; set; }
vb
<DefaultValue(WinControlPrintMode.Default)>
Public Property PrintMode As WinControlPrintMode

Property Value

TypeDefaultDescription
WinControlPrintModeDefault

A value that specifies whether to print a control inside the PrintableComponentContainer as a brick or as an image.

|

Available values:

NameDescription
Default

If a control is placed onto a DetailBand, ReportHeaderBand, or ReportFooterBand, it is printed as a set of bricks, if possible. If a control is placed onto any other report band, it is printed as an image.

| | AsImage |

A control is always printed as an image.

| | AsBricks |

A control is always printed as a set of bricks, if possible. It is possible, for example, in the case of a GridControl , PivotGridControl and other Developer Express controls. If a control can’t be represented as a set of bricks, it is printed as an image.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to PrintMode
PrintableComponentContainer

.WindowControlOptions .PrintMode

|

Remarks

This property specifies how to print a control that is placed inside the PrintableComponentContainer:

  • AsBrick
    A control is rendered as a Printing System brick.
  • AsImage
    A control is rendered as an image.
    The ImageType property specifies whether the image is a bitmap or metafile.
  • Default
    If the PrintableComponentContainer is placed onto a DetailBand, ReportHeaderBand, or ReportFooterBand, its control is rendered as a set of bricks. Otherwise, the control is rendered as an image.

Example

The code sample below creates a DataGridView control instance and adds this instance to a report. The sample specifies that the DataGridView control is printed as a bitmap image.

csharp
using DevExpress.XtraReports.UI;
using System.Windows.Forms;
// ...
// Create an XtraReport instance.
XtraReport report = new XtraReport()
{
    Bands = {
        new DetailBand()
    }
};
// Create a DataGrid control instance.
DataGridView dataGridView = new DataGridView();
// Create a PrintableComponentContainer instance for the data grid.
PrintableComponentContainer printableComponentContainer = new PrintableComponentContainer();
// Place the data grid inside the printable component container.
printableComponentContainer.WinControl = dataGridView;
// Specify that the control inside the printable component container is always printed as an image.
printableComponentContainer.PrintMode = WinControlPrintMode.AsImage;
// Specify that the control inside the printable component container is always printed as a bitmap.
printableComponentContainer.WindowControlOptions.ImageType = WinControlImageType.Bitmap;
// Add the printable component container to the report.
report.Bands[BandKind.Detail].Controls.Add(printableComponentContainer);
vb
Imports DevExpress.XtraReports.UI
' ...
' Create an XtraReport instance.
Dim report = New XtraReport()
Dim band = New DetailBand()
report.Bands.Add(band)
' Create a DataGrid control instance.
Dim dataGridView As New DataGridView()
' Create a PrintableComponentContainer instance for the data grid.
Dim printableComponentContainer As New PrintableComponentContainer()
' Place the data grid inside the printable component container.
printableComponentContainer.WinControl = dataGridView
' Specify that the control inside the printable component container is always printed as an image.
printableComponentContainer.PrintMode = WinControlPrintMode.AsImage
' Specify that the control inside the printable component container is always printed as a bitmap.
printableComponentContainer.WindowControlOptions.ImageType = WinControlImageType.Bitmap
' Add the printable component container to the report.
report.Bands(BandKind.Detail).Controls.Add(printableComponentContainer)

See Also

Use Third-Party Controls

Bricks

ImageType

WindowControlOptions Class

WindowControlOptions Members

DevExpress.XtraReports.UI Namespace