Hey guys,
As part of a job, I have a requirement that I will need to print a SSRS report using X++. However, my code just opens the menu item and populate the parm field like the picture below. It doesn't automatically run the report.
The weird thing is that I'm using the same code for other reports and it works normal, it prints the report without showing the menu item.

controller.parmReportName("BibPacReport.Design");
controller.parmExecutionMode(SysOperationExecutionMode::Synchronous);
controller.parmShowDialog(false);
select ItemId from prodTable
where prodTable.ProdId == prodId;
if (ProdTable)
{
select ItemNumber from bibPac
where bibPac.ItemNumber == prodTable.ItemId;
if (bibPac)
{
args.record(bibPac);
args.parmEnum(PrintCopyOriginal::Original);
args.parmEnumType(enumNum(PrintCopyOriginal));
controller.parmArgs(args);
settings = controller.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::Printer);
settings.printerName(printer);
settings.numberOfCopies(1);
controller.startOperation();
}
}
Above is the code that I'm using.
Any ideas what am I missing?
Thanks.