Manipulate Report Controls

  • 5 min to read

This document describes how to manipulate report controls in the Report Designer and customize the report's layout.

Access Report Element Settings

You can use the Property Grid to access selected element settings.

design-time-report-elements-property-grid

Click the gray area around the design surface to select the report.

design-time-selecting-report-property-grid

You can also use an element's smart tag to access its most commonly used settings.

picture-box-sizing-mode-zoomimage

Smart tags are available for most report controls, bands and a report itself.

winforms-getting-started-master-keep-together-with-detail

In addition to properties, smart tags can contain context links enabling you to perform various actions.

report-smart-tag-open-import

These commands are also available in the Property Grid.

design-time-context-links-property-grid

Move and Resize Report Controls

You can move report controls using the mouse in the same way you move other controls in Visual Studio. To select multiple controls, press and hold the SHIFT or CTRL key and click the required controls.

design-time-select-move-multiple-controls

You can select all the controls within a specific area by clicking an empty place on a report's surface and drawing a rectangle around the required controls.

design-time-select-multiple-controls

Use the handles displayed around selected controls to change their size.

design-time-resize-multiple-controls

You can also use the Report Explorer to move a control. You can move controls to other bands (except DetailReportBand), or into an XRPanel or XRTableCell controls. Select a control and drag it (either within the Report Explorer or to the design surface). The drop targets are highlighted when you drag the control over them.

design-time-move-controls

Note

You can drag the XRTableOfContents control only to ReportHeaderBand and ReportFooterBand.

Apply Styles to Report Controls

Select a control and switch to the Properties window. Expand the Styles group and set the Style property to the style name.

design-time-select-style

As an alternative, you can drag a style from the Report Explorer onto a control.

design-time-drag-style

Copy Report Controls

You can clone report controls. Hold the CTRL key and select a control, then move the mouse to the new control's location. The new control has the same settings as the initial control.

design-time-clone-controls

You can also copy report controls to the clipboard using CTRL + C or the Copy command, and then paste these controls to a new container or band.

  • The original control positions are preserved when you use the CTRL + V hotkey or the Paste toolbar command to insert controls.

    The pasted controls are repositioned by an offset of 10 units on both axes if another control already occupies the target position.

  • When you use the Paste context menu item, controls are inserted at the position where you invoked the context menu.

Reuse Report Controls

You can add selected controls to the Report Gallery and reuse them later in other reports.

report-gallery-add-controls

To add a selected template to a report, drag it from the Report Gallery onto a report's surface.

report-gallery-apply-controls-template

A template stores various settings related to its controls, such as binding information and appearance options. All these settings are restored after you add controls to a report.

Arrange Report Controls

The following tools allow you to control report element size, location, alignment, and to maintain the distance between them:

  • Rulers

    The Report Designer provides horizontal and vertical rulers to help you determine report elements' size and location.

    design-time-rulers

  • Layout Toolbar

    Use the Layout Toolbar commands to align report controls.

    design-time-layout-toolbar

  • Snapping

    A report's XtraReport.SnappingMode property defines whether automatic report control snapping is enabled and allows you to switch between snapping to a grid and/or snap lines.

    • Snap Grid

      The report's design surface displays a visual grid by default, which allows you to determine elements' size and location in a report. Use the XtraReport.SnapGridSize and XtraReport.SnapGridStepCount properties to customize the grid settings.

      design-time-snap-grid

      Set the XtraReport.DrawGrid property to false to hide the grid.

      Tip

      To select the measurement units applied to the grid size, use the XtraReport.ReportUnit property.

      Use the context menu to align the selected controls to the grid cells.

      design-time-align-to-grid

      A report control is aligned to the nearest grid cell when moved with the mouse or ARROW keys.

      Tip

      Hold down ALT when you use the mouse, or CTRL when you use the keyboard, to move or resize controls without snapping to the grid.

    • Snap Lines

      The Report Designer displays snap lines when you move or resize report controls. This enables you to align these controls to other report elements.

      design-time-snap-lines

      Tip

      When you move a report control with the ARROW keys or resize it with SHIFT+ARROW, this control is aligned to the nearest report element's snap line.

      To maintain a uniform distance between elements in a report, use report elements' XRControl.SnapLineMargin property and the band's or panel's XRControl.SnapLinePadding property.

      Tip

      Hold down ALT when you use the mouse, or CTRL when you use the keyboard, to move or resize controls without snapping.

Add Report Controls to Containers

The Panel control allows you to place various report controls on it to combine them into a group.

You can use this panel to move, copy, change appearance settings, etc. instead of adjusting individual controls.

A table cell can also act as a container for other controls.

Both panel and table cells cannot contain the following report controls:

If a panel or table cell includes only one control, you can use the Fit Bounds to Container command in the context menu to position the control within the container. This command resizes the control so that it occupies all the available space (except borders).

Validate the Report Layout

Your report layout should meet the following requirements to be correctly exported to specific formats:

  • Avoid overlapping controls

    Overlapping controls are highlighted in red.

    ShowExportWarnings

    Tip

    To ignore this rule and disable the highlight for overlapping controls, set the DesignerOptions.ShowExportWarnings property to false.

  • Avoid placing controls outside page margins

    Controls that do not fit into the printable page area are highlighted in red.

    ShowPrintingWarnings

    Tip

    To ignore this rule and disable the highlight for controls that overlap page margins, set the DesignerOptions.ShowPrintingWarnings property to false.