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...
Answered

Word Custom Report Layout Formatting Issue

(0) ShareShare
ReportReport
Posted on by 140

Hello,

We are formatting a Word document and uploading it to the Custom Report Layout. 

When we then apply some AL code on this document, to hide some data based on its condition, the formatting goes back to default and left aligns all the columns. 

We then re-upload the template which corrects the formatting but loses the AL formatting. 

In AL we are trying to hide the 0% on comment lines, and on Item lines where there is a 0%, show NETT instead. 

Layout.png_2D00_640x480.png

Is there a solution for this? 

  • Verified answer
    sVerme Profile Picture
    120 on at
    RE: Word Custom Report Layout Formatting Issue

    Hiding the value should be done in your AL-code. Check if the line is of type comment, and give it a value of ''. 

    for the alignment of the fields. This is a bug in Word, when you open the document it loses the alignment of fields in a table. 
    the value of the align gets removed from the XML for some reason. 


    You have to align them to the right again every time you open the document. 

    EDIT:
    You could try adding a nonbreaking space before your XML item in your table. 
    Sometimes this helps to stop it from losing its alignment.

  • GazzR Profile Picture
    140 on at
    RE: Word Custom Report Layout Formatting Issue

    Thanks for the suggestion, but it hasn't made any difference.

  • Nitin Verma Profile Picture
    21,384 Moderator on at
    RE: Word Custom Report Layout Formatting Issue

    Ok,

    Please go to the Report Layout > Choose New layout and do as per below image.

    pastedimage1665041387954v1.png

    After filling this Click on Replace Layout and choose your custom Layout, and then Make that as default layout and then run the report again from the Order page.

    Hope it will resolve your issue.

    Thanks.

  • GazzR Profile Picture
    140 on at
    RE: Word Custom Report Layout Formatting Issue

    pastedimage1665041077765v1.png

    Example of the difference in formatting after applying some formatting in AL. 

  • GazzR Profile Picture
    140 on at
    RE: Word Custom Report Layout Formatting Issue

    From the Order Page

  • Nitin Verma Profile Picture
    21,384 Moderator on at
    RE: Word Custom Report Layout Formatting Issue

    Hi,

    Are you previewing this from Custom Layout? Or direct from order page?

    Thanks.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,886 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,768 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans