Skip to main content
A newer version of this page is available. .

PrintableComponentContainer.PrintableComponent Property

Specifies a control or a printing link inside the PrintableComponentContainer at runtime.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.2.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core

Declaration

[Browsable(false)]
[DefaultValue(null)]
public object PrintableComponent { get; set; }

Property Value

Type Default Description
Object null

A Object value.

Remarks

The PrintableComponentContainer allows you to add the following elements to a report:

Create a PrintableComponentContainer class instance. Assign a control or document instance to the container’s PrintableComponent property at runtime. Add the PrintableComponentContainer instance to a report band.

See Use Third-Party Controls for more information.

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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PrintableComponent property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also