Add Filter to report

rico1931
Member Posts: 295
Hi Everyone,
I think I'm missing something so simple but seem to be missing it and wondering if you all can help. I'm trying to modify report 10156 Purchase Order Status to be able to filter on the header for Purchaser Code. Users would like the report to show their PO's that are outstanding.
I've added the Purchase Header to the DataItem, and added the filter to the C/AL Globals and properties. Go the section to show up on the RequestForm.. but it does nothing :-(
I'm going to take a ball park guess and thinking I have to set some filters in the OnAfterGetRecord() portion but I'm stuck
Any direction would be grateful. Even a "hey go look at this report #??" would be really appreciated.. sorry but I just don't have much experience with reports and the online tutorials are just not helping. You are my only hope! :-)
I think I'm missing something so simple but seem to be missing it and wondering if you all can help. I'm trying to modify report 10156 Purchase Order Status to be able to filter on the header for Purchaser Code. Users would like the report to show their PO's that are outstanding.
I've added the Purchase Header to the DataItem, and added the filter to the C/AL Globals and properties. Go the section to show up on the RequestForm.. but it does nothing :-(
I'm going to take a ball park guess and thinking I have to set some filters in the OnAfterGetRecord() portion but I'm stuck

Any direction would be grateful. Even a "hey go look at this report #??" would be really appreciated.. sorry but I just don't have much experience with reports and the online tutorials are just not helping. You are my only hope! :-)
-rico1931
0
Answers
-
Right now you just added a DataItem, which is not connected to anything. You can filter as much as you want, there wont be happening anything.
Usually to do what you want the report to do, the dataitem should look this way:
---SalesHeader
SalesLine
Then set the DataItemLinkReference property accordingly, and Filter the Sales Header, this way only Lines, that apply to the filtered SalesHeader are processed.Austrian NAV/BC Dev0 -
Just so everyone knows for report 10156, this isn't done very easily in the report. I got help from our partner and found the simplest way was to just modify the Purchase Line table to include a new FlowField for Purchaser code on the line and do a lookup. Then just add that new field to the ReqFilterFields on the Purchase Line properties.-rico19310
-
Sounds like a hack to me... Usually it should be sufficient to add a dataitem "purchase header" above the purchase line, add purchaser code in the reqfilterfields, filter by document type and other desired (and available) fields. The dataitem for purchase line should be indented, and linked via primary key fields to the purchase header.
Using a flow field as a filter works, but costs more processing time. And you have an additional field for a trivial reason.
with best regards
Jens0
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