Report Sections

david.weeks
Member Posts: 96
Hello All
I am working on printing a picking list that depends on the status of the shipping advice field within the sales header (partial or complete).
Once that has been determined for each order, I need to check against the reservation table and only show order lines that currently have reservations against them.
If the status is complete, all lines need to have reservations for the location within each sales line for the order. If any lines are not reserved, nothing should print.
If the status is partial, the picking list should only print those lines that have reservations.
Question is - where should i put this code?
I have tried to place it within OnAfterGetRecord but the link between Sales Header and Sales Line is acting strange.
Ideas?
Thanks
I am working on printing a picking list that depends on the status of the shipping advice field within the sales header (partial or complete).
Once that has been determined for each order, I need to check against the reservation table and only show order lines that currently have reservations against them.
If the status is complete, all lines need to have reservations for the location within each sales line for the order. If any lines are not reserved, nothing should print.
If the status is partial, the picking list should only print those lines that have reservations.
Question is - where should i put this code?
I have tried to place it within OnAfterGetRecord but the link between Sales Header and Sales Line is acting strange.
Ideas?
Thanks
0
Comments
-
Hi All
I have placed my code within OnPreDataItem of the Sales Line data item i.e. the data items:
Sales Header
Sales Line
This I think is working, however for some reason, even if I comment out my code, when I run the report for all orders - the first order prints the first header twice and all subsequent body lines are not correct. If I print a single random order all is fine......
Why am I getting the first record from sales header being printed twice, meaning that the sales line records are printing for the wrong headers?
Ideas and is the right approach?
Thanks0 -
I would create a report with the salesheader as the main dataitem. Indented under this I would put the salesline table. Be sure to link the two so you get the saleslines for a given salesheader only and not all the saleslines for each salesheader... hope that made sense
Anyways. You have probably done this already!
Now.. on the OnAfterGetRecord on the salesline you would put the code that determines whether there are reservations for the line or not. If there isn't you should issue the command: CurrReport.SKIP. This will skip the salesline and move on to the next one.
The above should work as you wish......
Now if you don't want the section with info from the salesheader to be printed if there are no saleslines that have reservations on them you should change the properties on the salesheader-DATAITEM so the property "PrintOnlyIfDetail" is set to YES.Best regards
Tommy0
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