Today, the customer raised an interesting requirement to use reporting services to build a warning function. For example, only when the customer's account balance is less than 1000 yuan, send a geological warning email to a specific email.
I used to see the data-driven subtasks feature when using reporting services, but I didn't pay much attention to it. This time I thought I should be able to use this feature. However, here is a small trick: because there is no module implementing business logic in data-driven submodules, but because SQL syntax is supported, this function can be implemented through SQL.
What if we do?
1) create a new data-driven subcategory, select the report you need, click the subscriptions option, and then click New data-driven subcategory. Enter the basic information on the following page:
2) create a data source. This data source should be a database that can implement the logic you need and does not necessarily need to point to the data source of the selected report.
3) Input Logic
The key part is this subquery. When this condition is met, the email address will be returned to the subscriber, and the mail can be sent out.
There can also be other applications. For example, you can store all addresses in the mail list and then database them, use a query to return all email addresses, and fill them in the subscribed recipients, in this way, you can create a mail list subscription and sending system. If you have stored the personal information of the subscriber, you can also use it in the report. Although there are already many email subscription systems, this function is very practical if you need to distribute a large number of reports in the enterprise.