# report result not true

hi guys i have report as following

Document No. -quantity

1 5

1 -5

2 6

3 7

i want to get this result in separate report as following

1 5

1 -5

i write this code in after get record event of report but no result
QTY:=0;
SET RANGE(“Sales Shipment Line”.“Document No.”);
IF Quantity>0 and Quantity <0 THEN
IF FIND FIRST THEN
REPEAT
QTY+=Quantity;
UNTIL NEXT=0;

can any one told me what is the false in this code or correct

can this statement be true? Think…

IF 5>0 and 5 <0 THEN

IF Quantity>0 and Quantity <0 THEN

This statement will never execute, for any value of quantity.

I think your basic concepts are gone and u dont know the flow.

Ok doesn’t matter .

try if else according to the situation .

I know what i need what i need is to select the order that have negative value because is cancelled but you cannot select cancelled without you select main order

so that i write 5 and -5 as result but two are same based on document no as before can any one write the code in after get record to get this report

thankes

You only have to do it…

is the SETRANGE actually doing something?

what is this line supposed to select? why not Quantity<>0?

quantity <>0 not true because it will take positive and negative to all document no but i need to check if document no have two quantity negative and positive then select this document no in separate report (ex 5,-5,2,-2) i select only returned order from table and if order no x i returned so that when i returned then it will take negative value to quantity can any one send solving problem in fob file or by email please help me

Check this post…You have to build a logic that whether the document has positive and negative values…

http://dynamicsuser.net/forums/p/49403/254934.aspx#254934

Hi,

Try using two repeat until so i think this can be achived. Please forgive if its wrong i didn’t try it

Like

RecA.Setfilter (Doc no,Doc No2);

if Rec A find first then

repeat

RecB.setfilter(RecB.doc no,RecA.Doc no);

if RecB find first then

Repeat

if (RecB.qty+RecA.qty)<>0 then

curreport.skip;

until RecB =0;

until Rec A =0;

some think like this try your self keep pushing the Doc no when you are sucessful so it will skip the second repeat until look so the record will not be repeated.

can you send to me code but clear prajeesh because i try more time with this way but not have result