The application needs to determine when to run which layout because a report can have built-in layouts (RDLC and/or Word) and custom layouts (RDLC and Word).This is handled via several codeunits that follow a report execution flow. The following figure visualizes this flow:
This flow is executed when you run a report from the application and select Print, Preview or when you run a report via C/AL code:
HasCustomLayout()function to determine if the report has been set up with a custom RDLC or Word layout. If not, the default built-in layout is used.