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 :
Small and medium business | Business Central, N...
Suggested Answer

Word Layout – "Hide table row if field is empty" works for lines but not for header fields

(5) ShareShare
ReportReport
Posted on by 177

Hi everyone,

I'm working on a Word layout in Business Central (using the the Word add-in for report layouts Use the Word add-in for Business Central to layout document reports - Business Central | Microsoft Learn). I'm using the "Hide table row if field is empty" option, and it works for lines-level data. The rows are hidden in the Word document as expected when the specified field is empty.

However, when I try to apply the same logic to header-level fields, the row in the Word layout is not hidden, even if the field value is empty.

Has anyone else encountered this issue? For the header I use the same path as for the rows, but it doesn't work.

1/ I add a table 1 rows x 2 columns.
2/ In the first column I add the text manually: VAT registration no.
3/ In the second column I add the XML mapping field (as a plain text, not RTF): VATRegistrationNo.
4/ I select the entire row and click on the right side, in the XML mapping window, by right mouse button on "Header" and click "Repeater" (Without repeater it is also not works)
5/ I select the field in the table: "VATRegistrationNo." and from add-in I choose: "Hide table row if field is empty".
6/ And it doesn't work, the table with an empty value is visible in the preview print.
7/ And when I do the same for the fields from XML Mapping section: Line, it works.

Could someone try it and tell me the result? Instruct me what I am doing wrong? This is a very useful function.

Thanks in advance for any insights!

Best regards,

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,761 Super User 2025 Season 2 on at
    As far as I know, these two functions are for line, not for header.
    For header, you can control it in AL.
    Hopefully other experts can give you better advice.
     
    Thanks.
    ZHU
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,150 Super User 2025 Season 2 on at

    I agree with @Yun ZHU — the “Hide table row if field is empty” feature in Word layouts works only with table rows, not individual header fields.

     

    That said, I encountered a similar situation, and while it might not be the recommended approach, here's what worked for me:

     

    🔹 Instead of placing header fields directly in the layout, I created two tables in the body section — one for header values and one for lines.

    🔹 I then used the "Hide table row if field is empty" feature on the header value table rows.

    🔹 As a result, if a header field had no value, its row was automatically hidden, and the layout adjusted without leaving empty space.

     

    It’s a bit of a workaround, but it solved the issue for me.

    If you’d like a step-by-step guide, I’d be happy to share.

     

    ✅ Mark this answer as verified if it helps you.

  • Sohail Ahmed Profile Picture
    11,150 Super User 2025 Season 2 on at
    Are we talking about Table header or Header section of Report? sorry maybe my last response was for Report header section hide when no Value.
  • Matthew1 Profile Picture
    177 on at
    @Sohail Ahmed, to be more precised:
     
    I have a report ID: 1306, Sales Invoice. I exported it to word in order to change its layout.
     
    Now when I'm in Word, on the right side of screen i have XML mapping.
    The XML mapping consist among others, Header section and Line section. As follows:
     
     
    And now going back to my first post:
    When I'm using this functionality from Add-in: "Hide table row if field is empty", on fields from Header section above, it is not working but for fields from Line section works. I use this function exactly the same for both sections as I wrote step by step in the first post.
     
    Does your comment that you described is related with my problem? Because I don't fully understand. If so, I would kindly ask you to describe in more detail how to get around this problem.

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,126

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 744 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 674 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans