Skip to main content

Add Controls to a Report

  • 2 minutes to read

This document describes how to add controls to a report.

Add Controls from the Toolbox

Use the DX.24.1: Report Controls tab in Visual Studio’s Toolbox to add controls to your report.

toolbox-drop-report-control-label

Note

If you don’t see Report Controls on the Toolbox, see Troubleshoot Toolbox Items in Visual Studio - DevExpress Unified Component Installer for more information.

Add Data-Bound Controls from the Field List

You can drag fields from the Field List onto your report to add data-bound controls, after you bound your report to a datasource.

Add a Control

Drag a field from the Field List and drop it onto the report’s surface.

DesignTimeFeatures - FieldList3.png

To add a control of specific type, do either of the following:

  • Hold down the SHIFT key and drop a data field onto a report’s surface.
  • Right-click a data field and drop it onto a report’s surface.

This invokes a context menu where you can select which control to add.

toolbox-drop-report-control-specific-control

See the Bind Report Controls to Data Using Expression Bindings topic for more information on how to bind a control to data.

Add a Table

Hold the CTRL or SHIFT key and click several fields. Drop them onto the report’s surface to add a table with its cells bound to these fields.

toolbox-drop-report-control-table

Drop an entire data table from the Field List to add a report table with columns bound to the data table’s fields.

toolbox-drop-report-control-table-2

To add column headers, do either of the following:

  • Select the fields and hold the CTRL or SHIFT key when you drop them onto a report surface.
  • Drag and drop fields with the right mouse button.

toolbox-drop-report-control-table-headers

This adds a new table whose cells display the field names.

Add Content from External Sources

You can add text and graphics from external applications to your reports:

  • Drag a file, text or image from an external application onto your report.

    xtrareports-drag-rich-text

  • Copy a file, text or image from an external application, and paste it into your report.

    xtrareports-copy-text

The following table shows which file types transform into report controls:

File Type

Control

.TXT

An XRLabel control that contains file contents.

.PDF

An XRPdfContent control that contains PDF content.

.DOC, .DOCX, .RTF, .HTM, .HTML

An XRRichText control that contains file content.

.JPG, .PNG, .BMP, .GIF, .TIF, .SVG

An XRPictureBox control that contains the image.

See Also