简体   繁体   English

SSRS-基于参数选择的报告

[英]SSRS - Report Based on Parameter Selection

We have a web based report we are moving to SSRS. 我们有一个基于Web的报告,我们正在转向SSRS。 In the SSRS report, I need one report to be able to call three different stored procedures based on the selection of a parameter value, and the output / report display would also be different. 在SSRS报告中,我需要一个报告才能根据参数值的选择调用三个不同的存储过程,并且输出/报告显示也将有所不同。

I believe I can create three different datasets for each procedure but I don't want all three to actually run when the user selects "View Report", as that would be excessive execution. 我相信我可以为每个过程创建三个不同的数据集,但是我不希望当用户选择“查看报告”时这三个过程都可以真正运行,因为那样会导致执行过多。

How could I get only one procedure to be called and only the correct report section to show based on the parameter? 我如何才能基于参数仅调用一个过程并仅显示正确的报告部分?

Let me try and give an example if the above doesn't make sense: 让我尝试给出一个例子,如果以上没有道理:

Parameter: Report Type Values: Day / Month / Year 参数:报表类型值:日/月/年

If the user selects "Day" for the report type parameter, I need to call "SP_ReportDay". 如果用户为报告类型参数选择“天”,则需要调用“ SP_ReportDay”。 If the user selects "Month", I need to call "SP_ReportMonth" and if the user selects "Year" I need to call "SP_ReportYear". 如果用户选择“月”,则需要调用“ SP_ReportMonth”,如果用户选择“年”,则需要调用“ SP_ReportYear”。

Each report type would have different data displayed. 每种报告类型将显示不同的数据。 It isn't the same columns for ecah report and the data displayed is different. ecah报告的列不同,显示的数据也不同。

How would I show / hide sections based on the selection criteria along with calling the correct procedure? 如何根据选择标准显示/隐藏部分以及调用正确的过程?

If the result sets are different, you don't have many choices besides running all three sprocs. 如果结果集不同,那么除了运行所有三个存储过程外,您没有太多选择。 BUT you can add a parameter to each sproc that tells them, respectively, not to actually return any results. 但是,您可以向每个sproc添加一个参数,分别告诉它们实际上不返回任何结果。 Your report can set this parameter at run-time. 您的报告可以在运行时设置此参数。 You'll have to modify the body of your sprocs accordingly. 您必须相应地修改存储体。

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

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