简体   繁体   English

将参数从主报表传递到追溯SQL Server Report Builder 3.0

[英]Passing a parameter from main report to drillthrough SQL Server Report Builder 3.0

I am trying to restrict what users can view based on the branch that they work in. I have it working on my main report but I want to pass the branch parameter from my main report to a drillthrough subreport. 我试图根据用户所在的分支来限制用户可以查看的内容。我在主报表上使用了它,但是我想将分支参数从主报表传递到钻取子报表。 How can I do this in Report Builder 3.0? 如何在Report Builder 3.0中做到这一点? Thank you. 谢谢。

You can pass the parameter via the url . 您可以通过url传递参数。

Example: 例:

http://myrshost/ReportServer?/AdventureWorks 2008R2/Employee_Sales_Summary_2008R2&ReportMonth=3&ReportYear=2008 

Here we're passing the report parameter ReportMonth the value 3 and ReportYear with 2008 在这里,我们将报表参数ReportMonth的值传递给3,并将ReportYear传递给2008

An alternative to using a URL, you'd need the same parameters in both reports. 除了使用URL之外,在两个报告中都需要相同的参数。

  • Go to the properties of where you want the drill-through to occur. 转到要进行追溯的位置的属性。 Go to Action 行动起来
  • Select 'Go to Report', specify the report directory (this can be flat files or via the report server). 选择“转到报告”,指定报告目录(可以是平面文件,也可以通过报告服务器)。 Think this can also be a URL but I am not certain. 认为这也可以是URL,但我不确定。
  • Select 'Add'. 选择“添加”。 In the Name field, you want to put the parameter name of the parameter in the drill-through report, in the 'Value' field you want to enter the parameter of the report that you're currently in. 在“名称”字段中,要将参数的参数名称放入追溯报表中,在“值”字段中,输入当前所在的报表参数。

If you don't want the user changing this parameter, in the drill-through report, you can simply hide this parameter in the drill-through report. 如果您不希望用户更改此参数,则可以在追溯报表中将其隐藏在追溯报表中。

This is by far the easiest way of doing what you require I believe. 我相信,这是迄今为止您所需要的最简单的方法。 Hope this helps if you're still struggling. 希望这对您仍然有帮助的人有所帮助。

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

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