Skip to main content

WinControlContainer.PrintMode Property

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

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[DefaultValue(WinControlPrintMode.Default)]
[SRCategory(ReportStringId.CatBehavior)]
public virtual WinControlPrintMode PrintMode { get; set; }

Property Value

Type Default Description
WinControlPrintMode Default

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

Remarks

This property specifies how to render a control that is placed inside the WinControlContainer:

  • AsBrick
    A control is rendered as a set of Printing System bricks.
  • AsImage
    A control is rendered as an image.
    The ImageType property specifies whether the image is a bitmap or metafile.
  • Default
    If the WinControlContainer 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.

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);
See Also