web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Cover whitespace of a hidden control automatically in a report?

(0) ShareShare
ReportReport
Posted on by

Hi,

I have 3 labels with 3 textboxes arranged on 3 lines. Now the middle label and text box is visible based on a boolean. When middle line is hidden then report prints whitespace in the middle. Is there any way that last line automatically covers the whitespace if middle line is hidden.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    AJAnsari Profile Picture
    5,754 on at

    Have you considered selecting the entire middle row (instead of just the individual cells) and making it conditionally visible? You can make it visible if the boolean function for both the middle label and text box return a TRUE.

    I hope this helps. If my response has answered your question, please verify by clicking Yes next to "Did this answer your question?"

  • Community Member Profile Picture
    on at

    This text box and label is not in a table. So there is not any row technically.

  • Suggested answer
    Zaid Tariq Profile Picture
    2,274 on at

    Hi,

    Try changing the property CanShrink to TRUE.

    Thanks

  • Suggested answer
    AJAnsari Profile Picture
    5,754 on at

    Hi again Zulfi,

    I think I have a solution you'll like:

    So you have 3 textboxes arranged on 3 lines which would show Address1, Address2, and Address3.

    I suggest you make it 2 textboxes instead of 3:

    The first textbox is for Address1.

    The second textbox's expression would combine the expressions for Address2 and Address3 but insert a line break using the "vbcrlf" constant (Visual Basic Carriage Return Line Feed, i.e., a line break) between Address2 and Address3.

    But, you would wrap the vbcrlf with an IIF statement so that it is only used if Address2 is not blank, i.e., it is not "".

    Your expression in the second textbox would look something like this (pardon any syntactical errors - just trying to demonstrate a use case):

    =Fields!Address2.Value & IIF(Fields!Address2.Value<>"",vbcrlf) & Fields!Address3.Value

    This will only trigger vbcrlf (line break) if Address2 is not blank. Otherwise, Address3 will show up right below Address1.

    Note: you may need to use First(Fields!Address2.Value) and First(Fields!Address3.Value) if the above doesn't work well.

    This should do the trick for you.

    I hope this helps. If my response has answered your question, please verify by clicking Yes next to "Did this answer your question?"

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    You can achieve it in couple of ways on RDLC side you need to use IF condition in each textbox and if one is hidden replace that with 2 and so on... in each text box or else on the NAV side, store the values in an array and then use the COMPRESSARRAY function that way it will move all the blank lines at the end and there will no white space in between. It uses the same logic on standard report for Address display and so on...

    https://msdn.microsoft.com/en-us/library/dd301425.aspx

  • Suggested answer
    Tina Menezes Profile Picture
    2,582 on at

    Hi,

    I have written a blog on how to cover whitespace if a textbox value is empty in a NAV report. Here is the link to my blog:

    https://tinamenezes.wordpress.com/2017/10/30/technique-to-hide-whitespace-if-the-textbox-value-is-empty-in-a-report-in-dynamics-nav/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans