Group the records on a form having multiple datasources

Hi all i am not getting a way to group the records in a grid of forms on the basis of a two fields used on form grid in AX 2012

I have 3 data sources in my BOL form, WMSOrderTrans,SalesLine and InventDim and the BOL form is a child form of WMSShopment form.

Now the situation is i am getting all the required field on the grid after applying the joins on data sources but now i want to group the retrieved records and sum up the real type fields which i am unable to achieve …

I also tried same with AOT query object but when i add a group by field then no other data will be retrieved on form except that group by field data.

Please suggest the solution if u have , it will be really helpfull

Hiii, Guys i got the solution if any one is having same requirement kindli post on the same thread so that i can help