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

Adding Contents to a Report

  • 4 minutes to read

After connecting a report to a data source (and optionally, shaping the incoming data using the Query Builder), you need to include this data in a report.

Adding Report Controls

The easiest way to list data source content in your report is to drag a corresponding entity from the Field List and drop it onto the report’s detail band. Dropping a field onto a report’s surface creates a new report control bound to the corresponding field.

DesignTimeFeatures - FieldList3.png

You can add other controls to your report using the Visual Studio Toolbox. Its DX.17.2: Report Controls tab contains report elements that you can add to a report for displaying various types of content, such as text, images, charts or barcodes.

toolbox-drop-report-control-label

Note

On rare occasions, the installation does not add the corresponding tabs to the Toolbox correctly.

See How to resolve issues with Toolbox items if you come across this issue.

This document describes how to add the most commonly used controls to a report. See Toolbox - Supported Report Controls for a complete list of available controls.

Displaying Text

Use the following controls to display text in a report:

  • XRLabel

    Displays plain text in a report. You can customize the font settings for a label’s entire content only.

    report-contents-label

  • XRRichText

    Displays rich text in a report. You can assign different font settings to any part of the control’s contents and load contents from an external RTF file.

    report-contents-rich-text

  • XRTable

    Contains any number of XRTableCell controls arranged in one or more rows. Each table cell can display plain text or contain other controls.

    report-contents-table

  • XRCharacterComb

    Displays each character in a separate cell, which is useful when creating printed forms.

    report-contents-character-comb

Double-clicking any of these controls invokes an in-place editor where you can enter text and format it.

Controls_XRRichText_2

Use the corresponding toolbar for quick access to a selected element’s font settings.

shared-formatting-toolbar

Tip

You can open this toolbar by selecting View | Toolbars | XtraReports if it is missing in Visual Studio.

Labels and other text-oriented controls can display the following types of content:

  • Static content

    Once you specified a control’s content, it never changes in a published document.

    report-contents-text-static

  • Dynamic content

    This content is supplied from a connected data source. In a published document, it changes according to the printed data source record.

    report-contents-text-dynamic

    You can format dynamic content using a control’s smart tag.

    report-contents-formatting-text

  • Mixed content

    For labels and other text-oriented controls, you can combine the static and dynamic content within the same control.

    With the in-place editor, you can refer to data source fields by enclosing them into square brackets.

    report-contents-text-mail-merge

    You can format a data field’s value by selecting the field in the in-place editor and accessing the Format String editor via the control’s smart tag.

    report-contents-text-mail-merge-formatting

Displaying Page Numbers

Use the XRPageInfo control to display information about document pages, such as the current page number and/or total number of pages.

asp-lesson-2-07

You can use this control to add information about a report’s author and the document creation date.

See the following tutorials for detailed instructions:

Displaying Check Boxes, Images and Bar Codes

Dropping a Boolean data field from the Field List onto a report creates an XRCheckBox control bound to that field.

report-contents-check-box-drop-field-list

Checkboxes can display different states depending on the underlying data values.

report-contents-check-box-states

Use the XRPictureBox control to display images in a report. You can load an image from an external file or bind this control to a binary data source field.

report-contents-pictures

To display barcodes, use the XRBarCode control.

report-contents-bar-codes

Drawing Lines and Shapes

Use the XRShape control to draw simple graphics in a report, such as circles, crosses or arrows.

report-contents-shapes

The XRLine control enables you to draw straight or slanted lines within a single band.

report-contents-lines

The following controls enable you to draw lines and boxes spanning multiple report bands:

See Also