#1 2024-02-16 21:09:51

hlynch
Member
Registered: 2014-10-08

Scheduling reports question

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

#2 2024-02-16 21:34:46

hlynch
Member
Registered: 2014-10-08

Re: Scheduling reports question

Just in case, By Schedule I mean setup for a report to run at a time in the future. Not immediately.

Offline

#3 2024-02-17 13:58:27

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Scheduling reports question

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

#4 2024-08-14 14:58:46

Geoffrey
Member
From: Loerrach (Germany)
Registered: 2024-02-20
Website

Re: Scheduling reports question

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

#5 2024-08-15 06:43:05

Felix
Moderator
Registered: 2022-08-01

Re: Scheduling reports question

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

#6 2024-08-15 10:50:42

Geoffrey
Member
From: Loerrach (Germany)
Registered: 2024-02-20
Website

Re: Scheduling reports question

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:

datasink

The Check Box is behind and there is a line separator Between "Mail:" and "Email adress"

Thanks,

regards,

Geoffrey

Offline

#7 2024-08-19 15:12:08

Geoffrey
Member
From: Loerrach (Germany)
Registered: 2024-02-20
Website

Re: Scheduling reports question

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')"

datasink

As soon as I restart RS, I have no more the error.

Thanks,

Regards,

Geoffrey

Offline

#8 2024-09-13 08:56:59

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Scheduling reports question

Hi Geoffrey,

we raised RS-8647 for looking into this.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB