Report valus fetching from the next line

Dear All,

in my report having one display method ,that column valus coming from the next line.

Batch Onhand stock
001_0124 1
001_0125 24
001_0128 0
001_0133 9
001_0138 0

actual value for the 001_0125 is 1

and actual value for the 001_0128 is 24

actual value for the 001_0133 is 0

actual value for the 001_0138 is 9

for the batch item it is showing the next on hand stock value.How to rectify this problem

can you share the code of display method what you have written?


Check how u r relating the OnhandStock with u r BatchId

display real onhand()
InventTable inventTable1;
Inventtrans inventTrans,inventTrans1;
Inventdim inventdim,inventdim1;
//real accqtyrec,accqtyisue;
onhandstock = 0.0;
while select qty from inventtrans order by recid asc join inventdim
// while select qty from inventtrans join inventdim
where inventtrans.ItemId == Inventtrans_1.ItemId

&& inventdim.inventDimId == inventtrans.inventDimId
&& inventdim.InventSiteId == Inventdim_1.InventSiteId
&& inventdim.inventLocationid == Inventdim_1.inventLocationid
&& inventdim.inventBatchId == Inventdim_1.inventBatchId

onhandstock += inventtrans.qty;

return onhandstock;


check inventdim.inventDimId == inventtrans_1.inventDimId

i checked inventdim.inventDimId == inventtrans_1.inventDimId

it is ok but inventdim.inventDimId == no.of inventtrans_1.inventDimId

inventdim dim id = 00028 then inventtrans dim id = 0028,00028,00028,00028…

likathat on invendim dim id having no.og transactions in inventtransactio, dimid

have you tried with group by batchid?


try it once… :slight_smile: