[英]SSRS - Getting report selected parameter with JavaScript
I'm using Ifrme to add a SSRS report to my site. 我正在使用Ifrme向我的网站添加SSRS报告。
I want to send a link to the current filtered report, so I need to know the report's parameters. 我想发送一个指向当前过滤报告的链接,因此我需要知道报告的参数。 My question is how can I know (with JavaScript or either way) which paramters the select? 我的问题是我怎么知道(使用JavaScript或其中任何一种方式)选择哪个参数? I'm asking for the hidden paramaters also (which can by select by the report creator). 我也要求隐藏的参数(可以由报告创建者选择)。
Thanks in advance. 提前致谢。
My understanding of an iFrame is that it just references a webpage (or html content). 我对iFrame的理解是它只引用了一个网页(或html内容)。 I'm not sure about this, but I suspect that if you wanted to call components (ie, parameters) from an SSRS report, you would have to use the SSRS plug-in. 我不确定这一点,但我怀疑如果你想从SSRS报告中调用组件(即参数),你将不得不使用SSRS插件。 However, I haven't played around with that in quite a while. 但是,我在很长一段时间内没有玩过这个。
Another solution would be to put the link you want on the report itself which would take you to the report browser (away from your site) with all the current parameters carried through. 另一种解决方案是将您想要的链接放在报告本身上,这会将您带到报告浏览器(远离您的站点),并带有所有当前参数。 If you wanted to do it this way, you would create a textbox with text like "Click here", add an action to "Go to URL". 如果您想这样做,您可以创建一个文本框,其中包含“单击此处”等文本,向“转到URL”添加操作。
The url would be constructed like this: 网址将按如下方式构建:
="javascript:void(window.open(' & Globals!ReportServerUrl & "/Pages/ReportViewer.aspx?" & Globals!ReportFolder & Globals!ReportName & "&Param1=" & Parameters!Param1.Value & "&Param2=" & Parameters!Param2.value & "&Param3=" & Parameters!Param3.value & "'))"
Note, you could also add all sorts of other controls in the link that will hide the parameter bar, force certain rendering formats, etc. More details on that here . 注意,您还可以在链接中添加各种其他控件,这些控件将隐藏参数栏,强制某些渲染格式等。有关详细信息,请参阅此处 。
I know this isn't exactly what you're looking for but no one else had replied yet. 我知道这不是你想要的,但还没有其他人回复过。
Another way would be to get the parameters & their values via jquery: 另一种方法是通过jquery获取参数及其值:
var parameter_name = $('#MSOPageViewerWebPart_WebPartWPQ1').contents().find("table[name^='ParameterTable_m_sqlRsWebPart'] > tbody > tr span")[0].innerHTML;
var parameter_value = $('#MSOPageViewerWebPart_WebPartWPQ1').contents().find("table[name^='ParameterTable_m_sqlRsWebPart'] > tbody > tr select option ")[0].label;
You need to iterate on all the parameters. 您需要迭代所有参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.