You are not logged in.
Pages: 1
Would it be possible to schedule a report from a script, that would be emailed to a specified email address(s)?
Then would it be possible to run that script via URL, where the report parameters would be passed in on the URL?
If this is possible, any example script code available to teach how?
Offline
Just in case, By Schedule I mean setup for a report to run at a time in the future. Not immediately.
Offline
Hi hlynch,
for scheduling a report from a script to email, you can use either SendTo: https://reportserver.net/en/guides/scri … s/Send-To/ or, better: script datasinks: https://reportserver.net/en/guides/scri … Datasinks/
Both support scheduling, so you have the standard scheduler functionality from RS.
For running reports from URL: https://reportserver.net/en/guides/admi … a-the-URL/
For running scripts from URL: https://reportserver.net/en/guides/scri … rs/Basics/ (3.2. Executing Scripts via URL)
So you can write a script that is callable from an URL, passing any parameters necessary. This script may execute your report and send it via SendTo or via script datasink (or via a simple email datasink https://reportserver.net/en/guides/admi … Datasinks/ ) to the Email address(s).
If you don't want to send it immediately, as you say, you can also schedule execution e.g.: https://github.com/infofabrik/reportser … ler.groovy
Regards,
Eduardo
Offline
Hello,
I have a question about the SentTo, I read the documentation :
https://reportserver.net/de/dokumentati … 13-send-to
But I do not understand were the scripts need to be placed.
Thanks,
regards,
Geoffrey
Offline
Hi Geoffrey,
please have a look at Hooks Basics and Registering Hooks
TL;DR:
you can execute the script => hook exists until your reportserver is restarted
you can add "onStartup.d" => hook is registered on each start of the reportserver (just like executing it by hand while your reportserver is running)
Softwareentwickler bei Infofabrik
Offline
Hi Felix,
Thanks for you feedback, it's now clear for me. I tested and work fine.
However another question: why I have this strange layout with your example:
The Check Box is behind and there is a line separator Between "Mail:" and "Email adress"
Thanks,
regards,
Geoffrey
Offline
Hello,
By the way there is another problem with this, as soon the sendto script is executed (still with your unmodified sendToEmailScheduling.groovy example script) when a try to Edit a Schedule(no matter which one) and click on Next I have the following error displayed:
"(TypeError) : Cannot read properties of null (reading 'b')"
As soon as I restart RS, I have no more the error.
Thanks,
Regards,
Geoffrey
Offline
Hi Geoffrey,
we raised RS-8647 for looking into this.
Regards,
Eduardo
Offline
Pages: 1