Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

How to hide certain content in a word-layout?

Posted on by Microsoft Employee

Hello guys,

is there a possibility to hide areas in word layout?

For example, I would like to control via a certain flag that a second page may only be printed if the flag = True.

Thank you ;)

Categories:
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to hide certain content in a word-layout?

    Thank you for your ideas. You have helped me a lot with this!

    I have another question:

    The two layouts, which I have created, do I need for my reminders. Do you think that the change of the layouts will also be possible if I also want to print on the RequestPage in the filter "No." several reminders?

    I am afraid that this might not work. However, I work with dunning runs and sometimes dun 1000 customers per month. Therefore, the layouts have to to changed automatically. I have a flag that makes clear which layout should be used. This flag is a boolean field on the Issued Reminder Header.  

  • Suggested answer
    JAngle Profile Picture
    JAngle 33,135 on at
    RE: How to hide certain content in a word-layout?

    This video explains it well. Plus you can get the source code from GitHub: www.youtube.com/watch

  • Suggested answer
    Steven Renders Profile Picture
    Steven Renders 4,994 Super User on at
    RE: How to hide certain content in a word-layout?

    Yes, but it is something that you will need to program in AL, it is not possible out of the box.

    There's a function SetTempLayoutSelected in the ReportLayoutSelection table that allows you to change the layout on a report.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to hide certain content in a word-layout?

    I had this idea too, but I don't know how to call the two layouts then.

    I have created the word layouts and they also work, now it fails somehow beacuse of their call. I know that there are many different setup pages, but there I can always only choose a report with the exact ID. Like for example in the setup page for reminders.

    Do you know, how to to call a "layout", depending on a special flag?

  • Suggested answer
    Steven Renders Profile Picture
    Steven Renders 4,994 Super User on at
    RE: How to hide certain content in a word-layout?

    To my knowledge that is not possible in the Word layout, only the RDLC layout allows for scripting. 

    As an alternative you could create 2 word layouts and use AL code to use the one or the other depending on the flag. But that seems like a cumbersome solution in comparison with the RDLC layout ;-)

  • Suggested answer
    JAngle Profile Picture
    JAngle 33,135 on at
    RE: How to hide certain content in a word-layout?

    Via word this is not likely. The logic would have to be in the report code. Rdlc is a better fit here

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans