Selecting a specific report layout in code based on table field? [BC24]

garmoogarmoo Member Posts: 21
Hi all,

I have a single report to display technical details of five very similar but different items, and five different layouts in the rendering section. Is there a way I can specify which one to use through code based on a Report Layout field in my record, rather than having to get the end user to select the report layout in the request page every time they run the report? Maybe something in OnPreReport?

thanks!

Answers

  • garmoogarmoo Member Posts: 21
    It might not be the best way to do it, but I made it work by subscribing in a SingleInstance codeunit to the OnAfterSubstituteReport function in ReportManagement CU and using recref, keyref and fieldref to set a global variable which I then used to set the Layout Code in the OnSelectReportLayoutCode subscriber
Sign In or Register to comment.