简体   繁体   English

SSRS - 使用JavaScript获取报告选定参数

[英]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.

相关问题 SSRS - Javascript 报告加载事件 - SSRS - Javascript Report load event 是否可以将 javascript 嵌入到 SSRS 报告中? - Is it possible to embed javascript into an SSRS Report? axapta 2009 中 ssrs 报告中的 javascript 错误 - javascript error in ssrs report in axapta 2009 在SSRS报告中包括一个外部javascript文件 - Include an external javascript file in an SSRS report ASP按钮用参数打开SSRS报告的新窗口 - ASP button to open new window to SSRS report with parameter 使用 Javascript 在 ssrs 中创建 POP UP 子报告不起作用 - Using Javascript to create POP UP sub report in ssrs not working 在JavaScript中获取选定的单选按钮 - Getting selected radio button in JavaScript CheckboxList未在javascript中获取选定值 - CheckboxList not getting selected values in javascript SSRS 报告 — 在 URL 和相对 URL 中使用参数打开详细报告,因此它在区域中正常工作(涉及 XML 和 javascript) - SSRS report — open detail report with parameters in URL with relative URL so it works correctly in regions (XML and javascript involved) 当报表托管在Iframe中且其域与父页面的域不同时,无法从SSRS报表调用JavaScript - Calling JavaScript from SSRS Report is not working when the report is hosted in Iframe with domain different than that of Parent Page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM