a report design

Now I am developing a new report, but the running result isn’t correct.I think the trigger or property in the report caused the error, but I can’t find the errors. Would you be kindly to help me.Thanks very much! MY TARGET: A statistics report shows how many purchase order line for every vendor, as well as how many backlog order line (Requied Date < Workdate),how many Pass-due-confirmed order line (workdate>confirmed date AND workdate < required date),how many not-confirmed order line, how many pass-due-scheduled-receipt order line(workdate > Expected Receipt Date). My Design Processing **1.**set the Vendor,Purchase Line as DataItem. In the property of Purchase Line, DataItemLink was set as Buy-from Vendor No.=FIELD(No.) **2.**In the trigger OnPreDataItem() of Purchase Line,the code is as below: PurchaseLine.FIND(’-’); REPEAT TotalLine := TotalLine + 1; IF PurchaseLine.“Confirmed Date” = 0D THEN NotconfirmedLine := NotconfirmedLine + 1 ELSE BEGIN CASE OK OF WORKDATE > PurchaseLine.“Required Date” : BacklogLine := BacklogLine + 1; (WORKDATE > PurchaseLine.“Confirmed Date”) AND (WORKDATE < PurchaseLine.“Required Date” ) : PassdueconfirmedLine := PassdueconfirmedLine + 1; WORKDATE > PurchaseLine.“Schd. Rcpt. Date”: PassdueschrptLine := PassdueschrptLine + 1; END; END; PurchaseLine.NEXT; UNTIL PurchaseLine.NEXT = 0; **3.**In the OnPostDateItem() of Purchase Line, the code is as below: PurchaseLine.RESET; BacklogLine := 0; TotalLine := 0; NotconfirmedLine := 0; PassdueschrptLine := 0; by the way,I don’t place any other code in other trigger. Any help is welcome.Thanks again

Hi, In your code if you are writting code on a PurchaseLine global variable then you need not take a Purchase Line as dataitem.Next you also frgot to filter the purchase line global variable with vendor (Setrange(“buy-from vendor no.”,vendor.“no.”); As you already took Purchase Line as dataitem.Try the following code OnAfterGetRecord() of Purchase Line, the code is as below: TotalLine := TotalLine + 1; IF PurchaseLine.“Confirmed Date” = 0D THEN NotconfirmedLine := NotconfirmedLine + 1 ; IF WORKDATE > PurchaseLine.“Required Date” THEN BacklogLine := BacklogLine + 1; IF(WORKDATE > PurchaseLine.“Confirmed Date”) AND (WORKDATE < PurchaseLine.“Required Date” ) THEN PassdueconfirmedLine := PassdueconfirmedLine + 1; IF WORKDATE > PurchaseLine.“Schd. Rcpt. Date” THEN PassdueschrptLine := PassdueschrptLine + 1; OnPreDateItem() of Purchase Line, the code is as below: clear(BacklogLine); clear(TotalLine); clear(NotconfirmedLine); clear(PassdueschrptLine); clear(PassdueconfirmedLine); See that the variables are printed on the vendor footer section. hope this helps…[:)]

Hi, Just curious, what does “FJHXL” stand for. Hey lakshmi, how are you doing? by the way, the code seems fine and serves the purpose. cheers venu…

Thanks for your kindly help, Lakshmi. To Venu, FJHXL doesn’t stand for anything.I think no one will use the ID, so I use it. :slight_smile: