Hello,
I have some reports scheduled to email users. Every things works fine but We are getting 3 emails for one scheduled email report at the same time. any ideas or have anyone of you experienced anything like this?
Thanks!
Hello,
I have some reports scheduled to email users. Every things works fine but We are getting 3 emails for one scheduled email report at the same time. any ideas or have anyone of you experienced anything like this?
Thanks!
Without seeing how you have the schedule set up, it's going to be tough to help. If you can't post your schedule and email action, put the reporting.Data
logger onto debug, then filter by your project and report and see if that gives any clues.
Any project inheritance involved in your setup?
Was there any update on this ? I have a similar issue for a report that is configured in global project . Email is being triggered 11 times at scheduled time of 4AM daily . I have around 13 projects on this gateway including Global one. I have observed similar situation on the report that is configured on global project being triggered multiple times at a different site . Here are schedule details.
Any leaf project inheriting it will also execute the report.
I put automated reports into their own leaf project.
Configuring on global will trigger a report one for each project. We just moved the individual reports to the concerned project. But I am not sure if you can define for which project you can trigger the report when you configure it on global.
If you would like to not move the reports to the projects, you could use [system.report.executeReport] system.report.executeReport(path, project, [parameters], fileType)(https://docs.inductiveautomation.com/display/DOC81/system.report.executeReport)
and execute the report for the project you want to execute the report for.
in a case we configured a gateway timer script with a 15000 ms fixed delay and wanted to execute the report at around 4 pm. we needed to define a 20 second interval to trigger the execution because of the fixed delay. Not the best way to do it but it does the job for us. (note if your interval is longer then this code will trigger multiple times, in our case 20 seconds is perfect to not miss the schedule time and trigger just ones. works like a charm for us...)
#Sample:
target = system.date.now()
start = system.date.setTime(target, 16, 30, 00)
end = system.date.setTime(target, 16,30, 20)
if system.date.isBetween(target, start, end):
#pdf report
reportParameters = {"StartDate":system.date.addHours(system.date.now(), -10), "EndDate":system.date.now()}
settings = {"to":["a.mad@go.com","ss.Conne@msre.com","Fcico.Sal@em.com",niel.cl@utot.com"],
"smtpServerName":"Mail Relay", "from":"Report@Ign.com", "subject":"Plant Daily Production data"}
system.report.executeAndDistribute(path="reports/Daily Report", project="MES_Mobile", parameters=reportParameters, action= "email", actionSettings = settings)
Mahesh, please see Wiki - how to post code on this forum.
There's a pencil icon below your post so you can fix it.
Are you really posting company emails on the forum?
Thank you Transistor. i didn't know that...
Nope. Those names and emails are dummy