web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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 401 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
    Microsoft Employee 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
    IB-29041624-0 Profile Picture
    1,191 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
    IB-29041624-0 Profile Picture
    1,191 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
    401 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,687 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,041 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 974 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans