Reporting - Responsive Report Layouts with Control Anchoring (v20.2)

Reporting Team Blog
08 February 2021

When you design a report in the Report Designer, you can anchor controls to individual containers (to bands, panels, or table cells that host these report controls) so that they reflect changes made to the container. For instance, when you change page size, margins, or orientation, report controls are resized based on new page dimensions. This allows you to create a “responsive layout” for a report.

To create a responsive layout, set the control’s AnchorHorizontal property as desired. You can set it to Left (react to changes made to the left border), Right, or Both.

Specify the anchoring behavior in the Property Grid

The AnchorVertical property works in a similar fashion – except that the control reflects changes made to control height versus changes made to page height. See the AnchorVertical property description for more information in this regard.

Here’s how these anchor settings will affect reports generated/displayed within our Report Designer:

  • When table anchoring is disabled - no reaction to page changes:

    Table anchoring is disabled - no reaction to page changes
  • When table anchoring is active - the table follows page changes:

    Table anchoring is active - the table follows page changes

Prior to v20.2, to achieve the same effect at runtime in the Document Viewer, you had to write code to handle the PrintingSystem’s AfterMarginsChange and PageSettingsChanged events. With v20.2, this feature works out of the box. You can change margins or switch page orientation and produce the same results:

Responsive report layout in Preview

We have also recorded a short video that demonstrates how to use the horizontal anchoring functionality in DevExpress Reports.

If you’d like to read the video script associated with this video, please refer to the following PDF file: Responsive Report Layouts with Control Anchoring in Print Preview Video Script.

Your Feedback Matters

As always, we welcome your thoughts. Please comment below and let us know what you think about our anchoring feature. Should you have technical questions, feel free to contact us via the DevExpress Support Center.

FREE DevExpress Xamarin UI Controls

Deliver high-impact native mobile apps with our feature-rich Data Grid, Scheduler, Chart, TabView, Editors, and utility controls. Reserve your free copy today!
Christopher Jay
Christopher Jay
AWESOME.  I've been waiting to be able to do something like this easily for years.  This is a very welcome addition, thanks!
8 February 2021
dbSoft
dbSoft
Perfect!! It can save us from a lot of time!!
8 February 2021
Jose Isga
Jose Isga

Great!!!

8 February 2021
Engº Bruno Marques
Bruno Marques
Nice improvement. 
8 February 2021
CRM-531e0874-0c8b-40ea-8628-b245aadc2287
Shamsuddin
Awesome !
9 February 2021
CRM-39d4b45d-0bd8-4372-891e-df3d15b39718
Chris Zimmermann
Super. :-) Very nice feature indeed...
9 February 2021

Please login or register to post comments.