In sales line there is tow fields quantity and quantity shipped. i want to subtract the the two values and get it in report. The line value should print in Remain QTY1 and second value should print in Remain QTY2 and 3rd value should print in Remain QTY3 if more lines are there then it should print in Remain QTY3 The values which should come in report is marked in yellow.
Answers
-But give you some solution that might be helpful to you.
if salesline_rec.findset then begin
j:=1;
repeat
if j=1 then begin
remqty01+= qty-qtyshipped;
end;
if j=2 then begin
remqty02+= qty-qtyshipped;
end;
if j>=3 then begin
remqty03+= qty-qtyshipped;
end;
j+=1;
untile salesline_rec.next=0;
end;
I can understand that you where not able to understand my question.
I need to blank the value for the other thane(the red fields should be 0) fields which I have marked in yellow.
in the screenshot I added marked in yellow should come as like, Remain QTY1 should print only in first row, Remain QTY should print only in 2nd row and Remain QTY3 should print only in 3rd row if more then 3 line are there then then the values should print in Remain QTY3 from Sales line.
Change DataSource structure of report. Use "Export Packing Line" as first and "Sales Line" joined. In common, use "REPEAT..UNTIL" C/AL structures only if there no way to construct correct data source.
Yury
some changes came in requirement and its done for now
thanks again for helping