Serega
Serega

Reputation: 39

Send e-mail to multiple e-mail addresses from report

I have an SSRS report with customer information, including e-mail addresses. I can make sure Outlook is opened upon clicking an e-mail address:

="MailTo:" & Fields!Email.Value)

However, now I want to have a link in the report header which opens Outlook with all e-mail addresses in the report. I can create a stored procerdure like this:

DECLARE @_Email varchar(MAX)

SELECT @_Email = COALESCE(@_Email + '; ', '') + EmailAddress
FROM   MyTable

SELECT @_Email

However, the report has a lot of parameters already, and this is going to be another big procedure. Is there any easier way to do it using vbscript?

Upvotes: 0

Views: 2818

Answers (1)

Jeroen
Jeroen

Reputation: 63810

Here's one possible solution:

  1. Create a dataset "EmailAddresses" with a query like SELECT EmailAddress FROM MyTable
  2. Create a MultiValue Text parameter @EmailAddresses
  3. Set the default value to be retrieved from the "EmailAddresses" dataset
  4. Update your expression to ="Mailto:" & Join(Parameters!EmailAddresses.Value, "; ")

Per your choice you can keep the parameter visible, or make it internal/hidden.

Upvotes: 1

Related Questions