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

  • T_Mauser Profile Picture
    397 User Group Leader on at
    RE: How to use "Custom Report Layouts" within AL?

    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/

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: How to use "Custom Report Layouts" within AL?

    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.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: How to use "Custom Report Layouts" within AL?

    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
    Marco Mels Profile Picture
    on at
    RE: How to use "Custom Report Layouts" within AL?

    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.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans