Running total in Report

I would like to add a running total in a report. My report lists only Production Orders of which Finished Date > Due Date: (CurrReport.SHOWOUTPUT(“Finished Date” > “Due Date”)) Now I would like to count these ‘overdue’ Production Orders and calculate a % of the total Production order records in the chosen date range. Result is then a % overdue, which is an important figure when measuring the results of our manufacturing processes. How should I solve this?

Hi you will need a few Variables Vars TotalCounter Integer OverdueCounter Integer OverDuePC Decimal OnAfterGetRecord() TotalCounter += 1; IF “Finished Date” > “Due Date” THEN OverdueCounter += 1; Then on the OnPreSection trigger of the Footer section you can code IF TotalCounter <> 0 THEN OverDuePC := ROUND(OverdueCounter / TotalCounter * 100,1);

Hi Steve, You’re great![:D]

HI Michiel Its great you got the solution. here is one more suggestion, why not to use a filter on “finished date” on PredataItem trigger of the report instead of CurrReport.SHOWOUTPUT(“Finished Date” > “Due Date”)) This will fasten your report. WR Hari

Hi Hari, Ehhh. Sounds nice, but…how should this code on the OnPreDataItem look like? [:I]

hi place any of the code on the predataitem of table from where you are fetching the data. SETRANGE(“Finished Date”,“Due Date”,0101999D); note:- i am taking 01019999D as the upper limit of ur due date OR make a text string of ur due date and use setfilter as show below SETFILTER(“Finished Date”,’>%1’,DueDate); Both will work WR Hari