What report you are trying to Print?
I have printed sales packing slip using following code. Hope this will help you,
void printPackingSlipReport()
{
SalesPackingSlipController salesPackingSlipController;
SalesPackingSlipContract salesPackingSlipContract;
SRSReportExecutionInfo printMgmtExecutionInfo;
Args args = new Args();
SrsReportRunImpl srsReportRun;
CustPackingSlipJour custPackingSlipJour;
ReportName reportName = “SalesPackingSlip.Report”;
int documentId;
CustPackingSlipVersion custPackingSlipVersion;
;
select custPackingSlipJour
where custPackingSlipJour.SalesId == WMSPickingRoute.transRefId;
custPackingSlipVersion = custPackingSlipVersion::findLatest(custPackingSlipJour.RecId);
args.record(custPackingSlipJour);
salesPackingSlipController = new salesPackingSlipController();
salesPackingSlipController.parmReportName(reportName);
salesPackingSlipContract = salesPackingSlipController.parmReportContract().parmRdpContract();
salesPackingSlipContract.parmRecordId(custPackingSlipVersion.RecId);
salesPackingSlipController.parmArgs(args);
srsReportRun = salesPackingSlipController.parmReportRun() as SrsReportRunImpl;
printMgmtExecutionInfo = salesPackingSlipController.parmReportContract().parmReportExecutionInfo() as SrsPrintMgmtExecutionInfo;
printMgmtExecutionInfo = new SrsPrintMgmtExecutionInfo();
printMgmtExecutionInfo.parmReportRunId(newGuid());
documentId++;
salesPackingSlipController.parmReportRun(srsReportRun);
salesPackingSlipController.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::Printer);
salesPackingSlipController.parmReportContract().parmPrintSettings().printerName(IgnPackingSlipReportPrint::find(curUserId()).PrinterName);
//salesPackingSlipController.parmReportContract().parmPrintSettings().overwriteFile(true);
//salesPackingSlipController.parmReportContract().parmPrintSettings().fileFormat(SRSReportFileFormat::PDF);
salesPackingSlipController.parmReportContract().parmReportExecutionInfo(printMgmtExecutionInfo);
//salesPackingSlipController.parmReportContract().parmPrintSettings().fileName(@“C:\Report1.pdf”);
salesPackingSlipController.runReport();
}