Search code examples
devexpressxtrareport

Is possible to move up empty labels in a DevExpress XtraReport?


Is possible to move up empty labels in a DevExpress XtraReport?

I have a report and I need to move up labels with empty data. I desire that labels with no data don't be displayed and the others labels behind him could be moved up in order to take place of the other.

Scenario:

1st line - [EMPTY_DATA_1]
2nd line - [DATA_1]
3rd line - [EMPTY_DATA_2]
4th line - [DATA_2]

Desirable scenario:

1st line - [DATA_1]
2nd line - [DATA_2]

How can I add this behavior?


Solution

  • Theres a simple way to solve your problem. You just need to set the property "ProcessNullValues" with that value "SuppressAndShrink" in all labels that you want that have this behavior (move up in case of null data).

    xrLabel.ProcessNullValues = DevExpress.XtraReports.UI.ValueSuppressType.SuppressAndShrink;
    

    For futher information see the link bellow: https://documentation.devexpress.com/#XtraReports/DevExpressXtraReportsUIXRControl_ProcessNullValuestopic

    I hope that this answer could be helpfull.