Here below run an SSRS reort through code and add parameters to filter
SrsReportRunController controller;
Map queryContracts;
Query query;
QueryBuildRange range;
MapEnumerator mapEnum;
controller = new SrsReportRunController();
controller.parmReportName('GGPaymentJournal.GM_AR_Payment');
queryContracts = controller.parmReportContract().parmQueryContracts();
mapEnum = queryContracts.getEnumerator();
while (mapEnum.moveNext())
{
query = mapEnum.currentValue();
range = SysQuery::findOrCreateRange(query.dataSourceTable(tablenum(LedgerJournalTrans)),fieldNum(LedgerJournalTrans,JournalNum));
range.value('20000-0021');
}
//controller.startOperation();
controller.runReport();
////////////////////////////////////////////////Run RDP///////////////////////////////////////////////////////////////////
SrsReportRunController controller = new SrsReportRunController();
FT_SalesInvoiceAutoContract contract =new FT_SalesInvoiceAutoContract();
SRSPrintDestinationSettings settings;
super();
//////////////////////////////in 365 add this code inside the block////////////////////////////
Args _args = new Args();
_args.menuItemType(MenuItemType::Output);
_args.menuItemName(identifierStr(YourMenuItemName));
controller.parmArgs(_args);
_args.menuItemName(identifierStr(YourMenuItemName));
controller.parmArgs(_args);
/////////////////////////////////////////
controller.parmReportName(ssrsReportStr(FT_SalesInvoiceAuto, Design1));controller.parmShowDialog(false);
contract.ParmVoucher(CustInvoiceJour.LedgerVoucher);
contract.ParmHeaderText("Credit Invoice");
controller.parmReportContract().parmRdpContract(contract);
controller.startOperation();