I have project called AX PUSH Reports. I have 3 types of reports Daily, Weekly and Monthly.
The requirements is to save the Reports in designated folder that can access by the user and Email the Link/Path of the Shared folder, so that they can view and back track the reports.
Now my problem is, When the Batch Jobs Run on the given schedules, the file created last time is overwritten.
For Example in my Daily Reports:
What I want to do is to create new file every Run of Batch Jobs.
Please see below controller, this is what i used.
class CDRController_daily extends SrsReportRunController
public static void main(Args _args)
CDRController_daily controller = new SrsReportRunController();
date today_n = today();
str date_n = date2Str(today_n, 321, 2, 0, 2, 0, 4);
str fileName = strFmt('CDRDailyReport_%1', date_n);
fileName = System.IO.Path::ChangeExtension(fileName,#xlsx);
// Define report and report design to use
// Change print settings as needed
settings = controller.parmReportContract().parmPrintSettings();
settings.fileName(@'\\192.168.3.123\ax push report\CDR\Daily\' + fileName);
// Execute the report
Thank you in advance.
SalesReport_09032017.xls - date modified Sept. 03, 2017
SalesReport_09042017.xls - date modified Sept. 04, 2017
If the file name is different, then it shouldn't overwrite. Is it not happening in your case?
What happening right now is when the i set the Batch, the filename what it set is the only filename is using only therefore its only overwritten and is not creating new file for different day.