Reports sendEmail and writeFile vs executeAndDistribute

I have a report with some parameters.
I will be saving the report and emailing it.

Option 1
A gateway scheduled script with:

Option 2
A gateway scheduled script with:

The manual has a warning about executeAndDistribute() being blocked.
I think the warning also applies to sendEmail() and executeReport() too though.

I think using a gateway scheduled script will make sure the report is emailed and saved either way though.

Is there a big difference to consider in the two options?

executeAndDistribute() will clean up its temporary files. Otherwise there's no significant difference, if sending as attachments.

Consider storing in a database and using something like my Blob server to cough up the file on demand. Then your email can send just links.

1 Like


I will keep on schedule for now saving and emailing the report.

The second part bound my thoughts up.

For some reason when the email contained a report, I thought it was completely necessary to email.
Knowing the email can just be a link, I am not sure why more than a perspective page is needed.
I need to review my requirements in the next meeting.