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

How to use "Custom Report Layouts" within AL?

(0) ShareShare
ReportReport
Posted on by 397 User Group Leader

Hello guys,

does anyone have knowledge or a documentation about how to use custom report layout within AL? 

For example: 

  1. Different layouts are made for the shipment report 208
  2. On the basis of a condition, which can be created out of the salesheader the right custom layout should be chosen.
  3. Then the layout can be printed, send, ...

if condition "A" then Custom Report Layout  "A"  (208)  should be chosen

if condition "B" then Custom Report Layout  "B"  (208)  should be chosen

Thank you for any information!

Tom

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    www.dynamicsuser.net/.../14

    I will open this up to the community in case they have something to add.

    Thanks.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    I do not think you can do that for only the layout. Unless you build a RDLC layout that have different sections that you show or hide dependent of the condition you specify.

    But you can substitute the whole report and thereby indirectly substituting the layout.

    docs.microsoft.com/.../devenv-substituting-reports

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    I also came to think about another solution. You could of course design the report so that it presents totally different datasets depending on the different condition and then keep the layout the same. It basically depends on what you want to achieve in different scenarios.

  • T_Mauser Profile Picture
    397 User Group Leader on at

    NorthW 

    Thank you for your advise! 

    Just found something out about report selection that would fit very well into my scenario. Didn't find out yet how it actually works, because inside the Debugger the local variable has no information about the layout code after it was chosen. - but it works! xD

    ReportLaySelection.SetTempLayoutSelected('208-000001');
    
    Report.Run(Report::"Sales - Shipment", true, true, SalesShipHeader);

    pastedimage1662713622306v2.png

    Ref: https://yzhums.com/25943/

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 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans