Different wordlayout at runtime

Roger
Member Posts: 57
Hi,
Is there a possibility to change the wordlayout of a nav report before the report is printed? Could do that with C/AL Code?
Thanks for all hints, Roger
Is there a possibility to change the wordlayout of a nav report before the report is printed? Could do that with C/AL Code?
Thanks for all hints, Roger
Many thanks, Roger
0
Answers
-
Depending on how complicated the layout change is, you could just make two copies of the report and selectively run either A or B copy depending on whatever layout you want to use in the code. Would probably be the easiest / fastest way without over thinking / complicating it.0
-
To use this, the report has to go through Report Selection table.
Change the report id in Report Selection table (77), for examble Invoice.
Create you extra layouts in table 9651.
In tabel 9657 you can set layout per customer, there is an action on Customer Card for this. Here you can also specific an alternative email address for this report, so if the customer wants Invoices sent to a different email, than the one on the customer card, it will use that in Document Send function.
If you need it from C/AL then you use the SetTempLayoutSelected function in table 9651.
You set the layout before run, and then set it back afterwards.
ReportLayoutSelection.SetTempLayoutSelected("Custom Report Layout Code");
REPORT.RUNMODAL("Report ID",IsGUI,FALSE,RecordVariant)
ReportLayoutSelection.SetTempLayoutSelected('');
This i use on 2017, but should work in 2016 as well.Follow me on my blog juhl.blog0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions