#1 2022-06-02 03:09:52

Johann
Member
Registered: 2022-05-30

Sending Reports via Email - How to CC recipients

I am able to send reports via email to one or more recipients by adding users to the "Recipients" section, but what I need to do is actually to have some of the recipients as CC-ed. Is this possible and if so how would it be done?

Thank you!

Offline

#2 2022-06-07 08:44:25

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Sending Reports via Email - How to CC recipients

Hi Johann,

you can write your own custom "SendTo"-Scripts if you need functionality not available in ReportServer. Pls. take a look here: https://reportserver.net/en/guides/scri … s/Send-To/

Regards,
Eduardo

Offline

#3 2022-06-08 01:27:53

Johann
Member
Registered: 2022-05-30

Re: Sending Reports via Email - How to CC recipients

Thanks Eduardo. Will this solution actually change the GUI of the report scheduling?

Offline

#4 2022-06-08 08:53:36

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Sending Reports via Email - How to CC recipients

Hi Johann,

yes, you will get a new entry in "send to..." menu, and also a new entry for scheduling if supportsScheduling = true, refer to https://reportserver.net/en/guides/scri … s/Send-To/

12.1.3. Scheduling

Regards,
Eduardo

Offline

#5 2022-06-10 05:46:09

Johann
Member
Registered: 2022-05-30

Re: Sending Reports via Email - How to CC recipients

Hi Eduardo,

Not sure if I am missing something, but where should the code snippets be placed and do we run them like a typical groovy file (i.e. `exec script.groovy`)?

Additionally, how would we undo the changes and rollback to the original state of the SendTo configuration?

Last edited by Johann (2022-06-10 06:29:03)

Offline

#6 2022-06-10 06:43:56

Johann
Member
Registered: 2022-05-30

Re: Sending Reports via Email - How to CC recipients

A couple of clarifications I would like to make as well:

1. I noticed that in the full example (https://reportserver.net/en/guides/scri … s/Send-To/) 12.1.4 line 12

reportService = GLOBALS.getInstance(ReportService.class)

the `reportService` variable does not seem to be used in the script. May I check what it's purpose is supposed to be?

2. The documentation states that "The getId method is used to define a unique identifier to identify the send to target."
How do we obtain this unique identifier? I am not sure what value to use in the example given.

Thank you!

Offline

#7 2022-06-10 08:21:31

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Sending Reports via Email - How to CC recipients

Hi Johann,

1. yes, this is correct. You can remove this service if you don't need it.
2. this is a unique id you have to set, so this id cannot be used in another hooks. You can use any string that is not used in other hooks. You don't have to obtain it, you just set it and make sure it is not used anywhere else in your hooks.

Regards,
Eduardo

Offline

#8 2022-06-10 15:21:35

Johann
Member
Registered: 2022-05-30

Re: Sending Reports via Email - How to CC recipients

Hi Eduardo,

I see, thank you!

Offline

#9 2022-07-20 11:38:00

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Sending Reports via Email - How to CC recipients

Hi Johann,

we updated the documentation and added the example script here: https://github.com/infofabrik/reportser … ail.groovy

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB