How to hide empty space?

Posted by: mmoroz on 23 May 2023, 11:58 pm EST

    • Post Options:
    • Link

    Posted 23 May 2023, 11:58 pm EST - Updated 24 May 2023, 12:03 am EST

    I group data based on specific fields and use conditional expressions to display fields (if a field is empty, it should be hidden). However, when there is no data, empty space still remains. How can I prevent the space from being reserved if there is no data?

  • Posted 25 May 2023, 5:48 pm EST

    Hello Maksym,

    If the generalData.Adresse does not return a boolean value. I would suggest you to use the following expression instead:

    {IIF(IsNothing(generalData.Adresse) OR generalData.Adresse = "", true, false)}

    For reference, I have also attached a sample report. In the Address TextBoxes a similar expresison is used to hide the field when empty.

    SampleHideNullValues.zip

  • Posted 25 May 2023, 10:14 pm EST - Updated 25 May 2023, 10:25 pm EST

    I I used the condition you wrote but no result.

    Could you fix it in the file?

    This is a test template. Now I am testing whether your library is suitable for our project. But hiding elements without reserving space is a very important factor for us.

    template.rdlx-json.zip

  • Posted 4 June 2023, 10:49 pm EST

    Hello Maksym,

    I have tested this behavior out by using the following expression:

    {IIF(Adresse = "", true, false)}
    

    And the expression seems to be working fine as the control is hidden when Adresse is null. I checked this by giving a background color to the text box so I can see if whether the text box is being rendered empty or if it is not rendering at all. If you want to shrink the Table when the text box is null then I would suggest you to either have the TextBox’s height as low as possible initially so when a value is rendered the TextBox Expands automatically and you can also set the top and bottom Padding of the TextBox as well so when the text box is visible it always reaches a certain height that you reequire.

    As an alternative approach, you can also use a Banded List instead of a Table as in a banded list you can also find a CanShrink property for each section which can be used to shrink the section when the TextBox is not visible.

    Based on the above approach(s) I have modified the sample you have attached and attached it along with.

    template.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels