Query Class In Reports....Help Me;

i m just trying to do one thing…

i want to to do grouping on ITEMID

below code is working perfect on JOB and giving grouped itemId

but its is not working on REPORT…

taking an empty table as datasource,

but it is only giving me one ItemID

Help Me :0

public void executeSection()
Query q;
QueryRun qr;
QueryBuilddataSource qbds;
QueryBuildRange qbr;
InventTrans _inventTrans;
ProdBom _prodBom;
_itemId = ‘’;

q = new query();
qbds =q.addDataSource(tableNum(InventTrans));
qr = new QueryRun(q);

while (qr.next())
_inventTrans = qr.get(tablenum(InventTrans));
select * from _prodBom
where _prodBom.ItemId == _inventTrans.ItemId;
_itemId = _inventTrans.ItemId;



Add the inventTrans as dataSource to your report query(rather than building it) and put your queryRun related logic in fetch method of the report.