I am trying to email a report based on the day of the week. On Monday I want data from previous week and the rest of the week would be previous day. How do I access the report properties(StartDate and EndDate) of the report so I can change the date range?
Date = system.date.now()
DayofWeek = system.date.getDayOfWeek(Date)
#Mon
if DayofWeek ==2:
system.report.executeAndDistribute(path=“Ops Prod/DivisonalRollup”, project=“Downtime”, action= “email”,
actionSettings = {“to”:[“xxx@smithfield.com”], “smtpServerName”:“Mysmithfield SMTP Server”, “from”:"IgnitionReporting@smithfield.com", “subject”:“PM Rollup”})
#Tues-Sun
if DayofWeek ==3 or DayofWeek ==4 or DayofWeek ==5 or DayofWeek ==6 or DayofWeek ==7 or DayofWeek ==1:
system.report.executeAndDistribute(path=“Ops Prod/DivisonalRollup”, project=“Downtime”, action= “email”,
actionSettings = {“to”:[“xxx@smithfield.com”], “smtpServerName”:“Mysmithfield SMTP Server”, “from”:"IgnitionReporting@smithfield.com", “subject”:“PM Rollup”})