Suppress Record In Report

TheFox
Member Posts: 3
I am trying to modify the "Back Order Fill By Customer" report to suppress The Header Record if there are no sales lines to ship. Our report currently uses the Ship To Address as the Header Field to Display and if there are 0 records, it will still print out the Ship to Address. How do I modify this to suppress the record if the Qty is 0.
Sales Line - OnPreDataItem()
CurrReport.CreateTotals("Outstanding Quantity");
gtxtQtyOutCaption := Text000 + ' ' + FIELDCAPTION("Outstanding Quantity");
Sales Line - OnAfterGetRecord()
Item.GET("No.");
IF ("Sales Header"."Ship-to Code" <> gcodShipTo) THEN BEGIN
gcodLastShipTo := gcodShipTo;
gcodShipTo := "Sales Header"."Ship-to Code";
gdecLastQtyOutTotal := gdecQtyOutTotal;
gdecQtyOutTotal := "Sales Line"."Outstanding Quantity";
gblnShowHeader := TRUE;
END ELSE BEGIN
gdecQtyOutTotal := gdecQtyOutTotal + "Sales Line"."Outstanding Quantity";
IF (gdecLastQtyOutTotal <> 0) THEN BEGIN
gdecLastQtyOutTotal := 0;
END;
gblnShowHeader := FALSE;
END;
Sales Line - OnPreDataItem()
CurrReport.CreateTotals("Outstanding Quantity");
gtxtQtyOutCaption := Text000 + ' ' + FIELDCAPTION("Outstanding Quantity");
Sales Line - OnAfterGetRecord()
Item.GET("No.");
IF ("Sales Header"."Ship-to Code" <> gcodShipTo) THEN BEGIN
gcodLastShipTo := gcodShipTo;
gcodShipTo := "Sales Header"."Ship-to Code";
gdecLastQtyOutTotal := gdecQtyOutTotal;
gdecQtyOutTotal := "Sales Line"."Outstanding Quantity";
gblnShowHeader := TRUE;
END ELSE BEGIN
gdecQtyOutTotal := gdecQtyOutTotal + "Sales Line"."Outstanding Quantity";
IF (gdecLastQtyOutTotal <> 0) THEN BEGIN
gdecLastQtyOutTotal := 0;
END;
gblnShowHeader := FALSE;
END;
0
Comments
-
Whenever the PrintOnlyIfDetail property does not apply, I find myself just creating a boolean that will decide whether or not to display a section.
In this case, you are displaying the Header before you know, so you would have to change the section type to body. I hope that makes sense.0 -
I will try that and let you know how it goes.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