I am trying to create a report which shows 3 periods of consumption. The period is determined by the user.
I have looked at some reports to get an idea of how to do this, and came up with the following :
2 dataitems : item and item ledger entry : i have linked, and put filters on as required. ON the item ledger entry i have put the following :
OnPreDataItem()
CurrReport.CREATETOTALS(TotalInvtQty,InvtQty);
"Item Ledger Entry".SETFILTER("Posting Date",'>%1',ILEFilter);
OnAfterGetRecord()
Window.UPDATE(2,"Posting Date");
FOR i := 1 TO 3 DO
IF ("Posting Date" >= PeriodStartDate[i]) AND
("Posting Date" < PeriodStartDate[i + 1])
THEN BEGIN
InvtQty[i] := Quantity;
IF InvtQty[i] <> 0 THEN
PrintLine := TRUE;
Test := PeriodStartDate[4] + 1;
END;
When for example the user puts ending date = 20/02/07 the report runs ok, but the entries for 20/02/07 are not included in the totals. In the code I see there is "posting date" < periodstart date.. I tried to change this to =< but which cured it, but when running for 1D period length, this messed the figures up.
Can any one throw some advice on this one?
THanks
[/code]
Comments
StartDate EndDate
01/01/07 20/01/07
21/01/07 .....
and use the limits including the boundaries (>= StartDate & <=EndDate)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
thanks for the reply following your suggestion, i came up with the following, and it appears to have worked
Thats something else Ive learnt today!
[/code]
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.