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.v20.2.dll

Declaration

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

Property Value

Type Default Description
WinControlPrintMode

Default

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

Property Paths

You can access this nested property as listed below:

Object Type Path to PrintMode
PrintableComponentContainer

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.

Examples

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 System.Windows.Forms;
using DevExpress.XtraReports.UI;
// ...
// Create an XtraReport instance.
XtraReport report = new XtraReport() {
    Bands = {
        new DetailBand()
    }
};
// Create a DataGridView 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.PrintableComponent = dataGridView;
// Specify that the WM_PRINT message is used to print the control inside the printable component container.
printableComponentContainer.WindowControlOptions.DrawMethod = WinControlDrawMethod.UseWMPrint;
// Specify that the control inside the printable component container is always printed as an image.
printableComponentContainer.WindowControlOptions.PrintMode = WinControlPrintMode.AsImage;
// Specify that the printed image is a bitmap, not a metafile.
printableComponentContainer.WindowControlOptions.ImageType = WinControlImageType.Bitmap;
// Add the printable component container to the report.
report.Bands[BandKind.Detail].Controls.Add(printableComponentContainer);
See Also