简体   繁体   English

SSRS数据驱动订阅

[英]SSRS data driven subscription

I have created a data driven subscription for an SSRS report where I have written the dataset query to fetch the report parameters. 我为SSRS报告创建了数据驱动的订阅,在其中编写了数据集查询以获取报告参数。 Now, whatever email id I provide gets all the reports generated by passing different parameters. 现在,无论我提供什么电子邮件ID,都可以通过传递不同的参数来生成所有报告。 Here, I want to achieve is sending the report generated by a particular parameter to a particular email id. 在这里,我要实现的是将由特定参数生成的报告发送到特定电子邮件ID。 For all the different parameters, the reports generated should be delivered to different email ids. 对于所有不同的参数,应将生成的报告传递到不同的电子邮件ID。 Please help me if this is achievable in SSRS and how to achieve this? 如果这在SSRS中可以实现,请帮助我,以及如何实现? Your help will be very much appreciated. 非常感谢您的帮助。 Thank you! 谢谢!

When you create your subscription, check the "data driven subscription" radio box. 创建订阅时,请选中“数据驱动订阅”单选框。 This will display a "Dataset" heading with "Edit Dataset" button. 这将显示带有“编辑数据集”按钮的“数据集”标题。 Press that button and an empty text box will open. 按下该按钮,一个空的文本框将打开。 Paste your query in here and press validate. 将查询粘贴到此处,然后按验证。 If the query validates, press apply. 如果查询验证,请按Apply。 If it doesn't, it means there is an error in the query. 如果不是,则表示查询中存在错误。

Now in your dataset you will see your fields. 现在,在数据集中,您将看到您的字段。 Sometimes these will be formatted with xml. 有时这些将使用xml格式化。 Go down to your delivery and in the email field you can select "Get value from dataset". 转到交货,然后在电子邮件字段中选择“从数据集获取价值”。 Next to it pick the email field from your query. 在它旁边,选择查询中的电子邮件字段。 (If you have the xml field this might be hard to decipher... if you have dual screens put it on the left screen and mouse over for the full value) (如果您具有xml字段,则可能难以解读...如果您有双屏,则将其放在左侧屏幕上,然后将鼠标悬停以获取全部值)

For your parameters you can do the same theing with the "Get value from dataset" option. 对于您的参数,可以使用“从数据集获取值”选项执行相同的操作。

That's subscriptions via dataset in a nutshell. 简而言之,就是通过数据集进行订阅。

I did a workaround and got the solution. 我做了一个解决方法,并找到了解决方案。 I created a new table having two columns, one column with all the parameters and the next column with the corresponding email id. 我创建了一个新表,该表具有两列,其中一列包含所有参数,下一列包含相应的电子邮件ID。 In the dataset query I wrote the select statement by inner joining the two tables. 在数据集查询中,我通过内部连接两个表编写了select语句。 So, this way I achieved the required dataset and using that got me the required data driven subscription. 因此,通过这种方式,我获得了所需的数据集,并使用该数据集获得了所需的数据驱动订阅。 Thanks everyone for your replies. 感谢大家的回复。

As a standard variant of Mrityunjay Kumar's answer you may press EditDataSet on SubscriptionPage and may select field#1 as the input parameter of the report and may select field#2 as the email to send. 作为Mrityunjay Kumar答案的标准变体,您可以按SubscriptionPage上的EditDataSet,并可以选择field#1作为报告的输入参数,还可以选择field#2作为要发送的电子邮件。 After that you may choose field#1 in DeliveryOption and field#2 in ReportParameter on the same SubscriptionPage. 之后,您可以在同一SubscriptionPage上的DeliveryOption中选择字段#1,在ReportParameter中选择字段#2。 So sending reports will be depends on email in field#1 and parameter in field#2. 因此,发送报告将取决于字段1中的电子邮件和字段2中的参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM