Hi All Experts
I'm very troubled in displaying a reports that will show first record for an item. The report is to show all items that is gonna be label as dead
The table will look like below :
Item Type qty
xxx1 Stocktake 5
xxx1 sales 6
xxx1 sales 7
xxx2 sales 0
xxx2 Dead 0
xxx2 Sales 0
xxx3 reconc 1
xxx3 sales 1
xxx4 sales 0
xxx4 sales 0
Output should be:
xxx1 Stocktake 5
xxx3 sales 1
xxx4 sales 0
My output :
xxx1 Stocktake 5
xxx2 Sales 0
xxx3 sales 1
xxx4 sales 0
The report should only display the first record of an item. However, it should not display the first record if the subsequent records have a type 'Dead' in it.
I manage to display the first record without much difficulty. but it will still display first record if the second or third record have a type 'Dead' in it which I do not want this to happen.
What I am doing now is :
Following another thread i did this :
@freset
shared numbervar RecNo:=0;
place this in the group header.
take another formula
@fRecPerGroup
shared numbervar RecNo:=RecNo+1;
place it in the Detail secion
Under detail section :
shared numbervar RecNo;
if RecNo=1 and not({InTrans.Trans_Datetime} in DateTime (2004, 04, 01, 00, 00, 00) to DateTime (2009, 05, 29, 23, 59, 59))and not({InTrans.DESCRIPTION} startswith "STOCKTAKE")then
False
else if RecNo=1 and {InTrans.Trans_Datetime} in DateTime (2004, 04, 01, 00, 00, 00) to DateTime (2009, 05, 29, 23, 59, 59)and {InTrans.DESCRIPTION} startswith "STOCKTAKE" then
false
else if RecNo>1 then
true;
What the above code is doing is if it item transaction falls in 2004-2009 it will display it. For other records with other transaction type will only shows if it falls before 2004. Problem now is i tried many ways to add conditions if the item has a record with type 'dead' dun display any of that item. But i didn't made it. It omits the rest of the records without checking further after the first record meets the condition.
Can someone help me to modifies the above code ?
Ya help is highly appreciated. TQ
Regards
Darrennsz
I'm very troubled in displaying a reports that will show first record for an item. The report is to show all items that is gonna be label as dead
The table will look like below :
Item Type qty
xxx1 Stocktake 5
xxx1 sales 6
xxx1 sales 7
xxx2 sales 0
xxx2 Dead 0
xxx2 Sales 0
xxx3 reconc 1
xxx3 sales 1
xxx4 sales 0
xxx4 sales 0
Output should be:
xxx1 Stocktake 5
xxx3 sales 1
xxx4 sales 0
My output :
xxx1 Stocktake 5
xxx2 Sales 0
xxx3 sales 1
xxx4 sales 0
The report should only display the first record of an item. However, it should not display the first record if the subsequent records have a type 'Dead' in it.
I manage to display the first record without much difficulty. but it will still display first record if the second or third record have a type 'Dead' in it which I do not want this to happen.
What I am doing now is :
Following another thread i did this :
@freset
shared numbervar RecNo:=0;
place this in the group header.
take another formula
@fRecPerGroup
shared numbervar RecNo:=RecNo+1;
place it in the Detail secion
Under detail section :
shared numbervar RecNo;
if RecNo=1 and not({InTrans.Trans_Datetime} in DateTime (2004, 04, 01, 00, 00, 00) to DateTime (2009, 05, 29, 23, 59, 59))and not({InTrans.DESCRIPTION} startswith "STOCKTAKE")then
False
else if RecNo=1 and {InTrans.Trans_Datetime} in DateTime (2004, 04, 01, 00, 00, 00) to DateTime (2009, 05, 29, 23, 59, 59)and {InTrans.DESCRIPTION} startswith "STOCKTAKE" then
false
else if RecNo>1 then
true;
What the above code is doing is if it item transaction falls in 2004-2009 it will display it. For other records with other transaction type will only shows if it falls before 2004. Problem now is i tried many ways to add conditions if the item has a record with type 'dead' dun display any of that item. But i didn't made it. It omits the rest of the records without checking further after the first record meets the condition.
Can someone help me to modifies the above code ?
Ya help is highly appreciated. TQ
Regards
Darrennsz