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)))
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…
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.
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