Suppress Record In Report

TheFoxTheFox 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;

Comments

  • matttraxmatttrax Member Posts: 2,309
    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.
  • TheFoxTheFox Member Posts: 3
    I will try that and let you know how it goes.
Sign In or Register to comment.