Ax Report Dialog with select button

Hi ,

I have created report. i have added datasource in that report .

now it is showing me select button in dialog. when i click select button query window is opened where i can select ledger account.

Now if i select ledger account by using select button on dialog then report will print data only related to that account other wise it will need to print data related to all accounts.

I tried with following code but its not working.

queryRunCopy = new QueryRun(this);

while (queryRunCopy.next())

{

if (SysReportRun::changed(queryRunCopy,tablenum(LedgerTable)))

{

ledgerTable = queryRunCopy.get(tablenum(LedgerTable));

// while select statement sql statements here.

}

}

does any one knwo how to do that…

any help would be appreciated.

thanks…

Hi,

If u hav added the datasource to ur report then by default filter is there on its unique field,

No need to write any query for that …Test it by commenting ur query code…Hope it works

hi Jyothi,

thanks for reply…

yes you are right when we add datasource select button will come automatically.

but what i need to do is if i don’t select anything then it will print report for all account numbers and if i select any account number using that select button it will need to print data only related with that account number only…

for that i need to take query…

i tried with the way you said its not working…

do you know how to do that…?

thanks…

Hi,

It will take automatically…

Anyway Can i know what u hav written in fetch() of ur report

Hi Jyothi,

Thanks for reply.

i have written following code in my fetch method.i have ledgertrans table in datasource of report.

queryRunCopy = new QueryRun(this);

while (queryRunCopy.next())

{

//if (SysReportRun::changed(queryRunCopy,tablenum(LedgerTrans)))

{

ledgerTrans3 = queryRunCopy.get(tablenum(LedgerTrans));

while select dataArea where dataArea.isVirtual==false

{

changecompany(dataArea.id)

{

ledgerTrans=null;

while select * from ledgerTrans group by AccountNum,Dimension[1],Dimension[2],Dimension[3]

{

element.send(ledgerTrans);

}

}

}

}

}

If you dont want to modify the criteria of the query, then better remove the fetch method and run the report, and it will work,

here the problem with your code is U have used ledgerTrans3 to get the data from the query dialog, but you are sending LedgerTrans for printing the report, which always fetches all te records regardless of ur dialog Query.

Hope this will help U :slight_smile:

Hi,

What is the need to write query if u want to filter with unique id(AccountNum)?..Try to run without any query and check…Once u add dataSource to ur report then it defaultly provide filter on its unique field

Hi jyothi,

Thanks for reply

yes ,you are right it will take care automatically.

thanks for reply

Prasankumar ,

thanks for reply,

I got solution.

thanks you all …who reply…