Hi try code below . I am using it for sending email with my own file. You can use it and save your file on ur destination
SrsReportRunController controller = new SrsReportRunController();
HRMParameters parameter = HRMParameters::find();
SRSPrintDestinationSettings settings;
FilePath outputFilePath;
Str1260 subject,body;
;
subject = "active employee report";
body = "your hTML body"
// Define report and report design to use
controller.parmReportName(ssrsReportStr(ReconReport, PrecisionDesign1));
// Use execution mode appropriate to your situation
//controller.parmExecutionMode(SysOperationExecutionMode::ScheduledBatch);
// Suppress report dialog
controller.parmShowDialog(false);
controller.parmLoadFromSysLastValue(false);
// SrsReportDataContract srsReportDataContract = controller.parmReportContract();
//srsReportDataContract.parmisMemoryStreamOnly(true);
//controller.parmReportContract(srsReportDataContract);
// Change print settings as needed
settings = controller.parmReportContract().parmPrintSettings();
// set the print destination in contract
settings.overridePrintContractSettings(true);
settings.printMediumType(SRSPrintMediumType::Email);
settings.emailAttachmentFileFormat(SRSReportFileFormat::Excel);
settings.emailTo(email@gmail.com);
settings.emailSubject(subject);
settings.fileName('ReconData');
settings.parmEMailContract().parmBody(body);
//settings.overwriteFile(true);
controller.parmReportContract().parmPrintSettings(settings);
// Execute the report
controller.startOperation();