Hi, I have setup a batch job to run a report and send it in excel format recurrently every morning. Now a user has requested to include the date in the subject of that email that is being sent through batch every day. Below is a part of the code in my controller class of the report
myDateTime = DateTimeUtil::getSystemDateTime();
myDateTime = DateTimeUtil::applyTimeZoneOffset(myDateTime,DateTimeUtil::getUserPreferredTimeZone());
contract = myController.parmReportContract().parmRdpContract() as MyContract;
printSettings = myController.parmReportContract().parmPrintSettings();
emailSubject = strFmt("My email subject - %1", myDateTime);
printSettings.emailSubject(emailSubject);
myController.parmReportContract().parmPrintSettings(printSettings);
myController.parmReportContract().parmRdpContract(contract);
myController.startOperation();
But it uses same date time in subject every day. Meaning, the date time is not getting updated each run. Because controller is called just once when setting up the recurring batch. I will really appreciate any suggestions on where should I make changes to update the subject line on each batch run.
Thank you!
GJ
*This post is locked for comments
I have the same question (0)Look at outputReports method of SrsPrintMgmtController class, there you have access to print management settings and should be able to change email subject for each report run.
Syed Haris Shah
9
Mea_
4
Martin Dráb
2
Most Valuable Professional