Try using following code to generate report in pdf
SrsReportRunController ssrsController = new SrsReportRunController();
SalesPackingSlipContract contract = new SalesPackingSlipContract();
SRSPrintDestinationSettings printerSettings;
PackingSlipId packingSlipId;
custPackingSlipJour custPackingSlipJour;
System.Exception e;
try
{
packingSlipId = 'DO-0001';
select custPackingSlipJour
where custPackingSlipJour.PackingSlipId == packingSlipId;
contract.parmRecordId(custPackingSlipJour.RecId);
ssrsController.parmReportName(ssrsReportStr(SalesPackingSlip, Report));
ssrsController.parmExecutionMode(SysOperationExecutionMode::Synchronous);
ssrsController.parmShowDialog(false);
ssrsController.parmReportContract().parmRdpContract(contract);
//link the printer settings to the controller
printerSettings = ssrsController.parmReportContract().parmPrintSettings();
//print to pdf and always overwrite if the file exists
printerSettings.printMediumType(SRSPrintMediumType::File);
printerSettings.fileFormat(SRSReportFileFormat::PDF);
printerSettings.overwriteFile(true);
printerSettings.fileName(filename); //Speicfy your file name
//run & save the report
ssrsController.runReport();
}
catch (Exception::CLRError)
{
e = ClrInterop::getLastException();
while (e)
{
info(e.get_Message());
e = e.get_InnerException();
}
info(strFmt("%1",e));
}