xtrareports-devexpress-dot-xtrareports-dot-ui-50a42957.md
Specifies how to print a control assigned to a PrintableComponentContainer.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
public class WindowControlOptions
Public Class WindowControlOptions
The following members return WindowControlOptions objects:
When you create a PrintableComponentContainer to print a control in a report, you can specify how to render the control inside the container. Create an instance of the WindowControlOptions class and assign it to the container’s WindowControlOptions property.
The following WindowControlOptions properties specify how to render a control inside the PrintableComponentContainer :
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);
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)
Object WindowControlOptions
See Also