Auto Emailing Using Chosen Parameter

Auto-emailing a report on a chosen parameter

I am seeking a way to automatically email a report dependent upon the parameter chosen for the report.

I would like to use the email plug-in but I want the report to run for a set of parameters and dependent upon the parameter chosen it will look up the appropriate email address from a SQL table.

How:  Using a Pass Through Variable

The key is that Pass Through Variables can be used to affect the syntax in the Add-In property (as well as macros) on a report.

1. Add a Pass through variable to the Container for the report and call it EmailTo

2. When prompted for the code for the pass through variable call it @EMAILTO@

3. Add a new Parameter to the report and select EmailTo expression for the parameter

3. In the Run-Add In property on the report put an add-in to this effect (you can use the add-in wizard to construct it as well)

PLPLUGA.E.MailSMTP(smtpservername,@EMAILADD@,[email protected],Test,Test,1)

4. Note in the TO parameter to the Add-in instead of a hard code email address use the pass through variable

5. Schedule your report and choose the rep for one of the parameters and enter the corresponding email for the rep in the other.

You can however take it one step further and get a lookup button working for the email addresses by going to the Pass through variable in the Connector module and on the Pass through variable expression modify the Lookup Type. You can then allow the list to be driven from a select statement against the table that you have the email addresses in.