Cross Company does not showing data from different companies..

Hi ,

i have created a report which will display company info along with account number.

i want to display account number from different company grouped by account number and dimension.

so i write following query in fetch method but it showing data from only one company .

please help me to solve this. the query i have written is as follows

container company = [‘ceu’,‘cee’,‘cec’,‘dat’,‘ppt’,‘tst’]; //(define your list of companies)


while select crossCompany:company * from ledgerTrans group by AccountNum, Dimension



info(strfmt(’%1 - %2 - %3 - %4 %5’, ledgerTrans.dataAreaId, ledgerTrans.AccountNum, ledgerTrans.Dimension[1], ledgerTrans.Dimension[2], ledgerTrans.Dimension[3]));


return true;

any help would be appreciated…


Have you tried by changing the query property Allow Cross Company to Yes…

Hi kranthi,

thanks for reply

yes i have already made allowcrosscompany property to yes

but still its not showing data from only one company.

can you please help me…

Try by using the below code example

public boolean fetch()
QueryRun qr = new QueryRun(this);
QueryBuildDataSource qbds = qr.query().dataSourceTable(tablenum(LedgerTrans));


while (
ledgerTrans = qr.getNo(1);

return true;

Hi Kranthi,

thanks for reply and code.

I tried with code you have given but still its not working.

I add more companies in range as follows




it is showing data from only current company not from cross companies.

any idea…


It works for me, try to debug the code…

Hi kranthi,

Thanks for reply.

I tried using following code.

its working for following code.

LedgerTrans ledgerTrans;

while select crosscompany ledgerTrans order by dataAreaId

group by accountnum,dimension[1],dimension[2],dimension[3],dataAreaId


info(strfmt(’%1-%2-%3-%4-%5’, ledgerTrans.AccountNum,ledgerTrans.dataAreaId,ledgerTrans.Dimension[1],ledgerTrans.Dimension[2],ledgerTrans.Dimension[3]));


I think problem was with dimension. so i tried dimension[1],dimension[2],dimension[3].
then it worked…

thanks for reply…