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;
0
Comments
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.
My Blog - nav.education