I made a query based report n which the report should run for selected record only like P.O. confirmation report or invoice report..
Please suggest solution .
Regards
Nakul
*This post is locked for comments
Hi Nakul
If a report have a query as datasource, you can override the method prePromptModifyContract of the controller class and handle the selected record like :
SalesTable salesTable;
QueryBuildDataSource qbdsTable;
salesTable = this.parmArgs().record() as SalesTable;
if (salesTable)
{
qbdsTable = this.getFirstQuery().dataSourceTable(tableNum(SalesTable));
qbdsTable.clearRanges();
SysQuery::findOrCreateRange(qbdsTable, fieldNum(SalesTable, SalesId)).value(queryValue(salesTable.SalesId));
}
You can also condition the "showQuerySelectButton" method as well.
You can return false if you have a selected record to avoid that user can changed the query.
Obviously, when you click the Output button compare a dialog form where you can set the print destination.
That's it!
Hi Nakul,
Seems impossible. You'd probably need to use RDP instead of AOT query as datasource.
Regards,
Dominic Lee
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156