overriding DataItemTableView

generaljim
Member Posts: 8
It's been about a decade since I've been in the NAV world, so bear with me please. I’ve got a report running pretty well from a form via a Print button (it only prints the records that show on the form), but I can’t seem to get the sorting to be in the same order that it is on the form. I need to show the Options tab of the report, but don’t want the user to see the Request tab for the table that the report is based upon. So I had to set the DataItemTableView of the table on the report to get that tab hidden. Unfortunately that also seems to override the COPY I did from the Form’s Print button to get the filters and current key in play when running the report. Do I just have to let them see the table’s request tab by removing the DataItemTableView and make them go to the Options tab themselves? There’s a field on the Options tab that is required in order for the report to run. I *think* that’s the right answer, but I was hoping that there was some sort of change NAV did in the last decade that would allow me to get around this. Here's the code behind the Print button:
lDorders.COPY(Rec);
REPORT.RUNMODAL(REPORT::"Door Prod Tickets",TRUE,FALSE,lDorders);
Thanks for any information on this.
lDorders.COPY(Rec);
REPORT.RUNMODAL(REPORT::"Door Prod Tickets",TRUE,FALSE,lDorders);
Thanks for any information on this.
0
Answers
-
You could write a function in the report where you specify the key, set a flag or something.
And in the OnPreDataItem of the DataItem in the Report you do the setcurrentkey.
The Call of the Report looks then like this:lDorders.COPY(Rec); DoorProdTickets.KeySettingFunction(DoItMyWay); DoorProdTickets.SETTABLEVIEW(lDorders); DoorProdTickets.RUNMODAL;
0 -
Thanks for the response. I ended up setting the DataItemTableView on the table to prevent the tab from appearing and then did the following to override that setting. I made the Print button do one additional thing from my previous post by calling a function in the report:
lDorders.COPY(Rec);
DoorOrdPrint.getDorderRec(lDorders);
DoorOrdPrint.RUNMODAL;
And then the function getDorderRec in the report set a global variable gblDorders (DorderParam is the parameter with the Var checked):
SetViewString := DorderParam.GETVIEW;
gblDorders.SETVIEW(SetViewString);
And then in the OnPreDataItem trigger of the table in the report, I added this:
Dorders.SETVIEW(gblDorders.GETVIEW);
Just trying to create a roadmap here for anyone needing to follow this later - myself included!
Thanks again.0
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