简体   繁体   English

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)

Per the questions below, in order to open an SSRS report in a new tab or new window, one has to use javascript and a URL.根据以下问题,为了在新选项卡或新 window 中打开 SSRS 报告,必须使用 javascript 和 URL。

Previous Question #1 上一个问题 #1

Previous Question #2 上一个问题 #2

The need is to have the detail report open in several regions, such as dev-region, int-region, and production (prod).需要在多个区域中打开详细报告,例如 dev-region、int-region 和 production (prod)。 The answers above would have absolute URL's, all different.上面的答案将具有绝对URL,都不同。 Is it possible to do this with relative URL's?是否可以使用相对URL 来执行此操作? If so, what would the example syntax be, please?如果是这样,请问示例语法是什么?

NOTE: It may be assumed that the two SSRS reports (the parent or summary and the child or detail) are in the SAME folder.注意:可以假设两个 SSRS 报告(父级或摘要和子级或详细信息)位于同一文件夹中。 This should greatly simplify a relative URL-styntax.这应该会大大简化相对 URL 语法。

Also, I was able to answer question below, the answer ALSO covers everything one needs to open an SSRS detail report in another window (Should work for ssrs-2008-r2 and above).此外,我能够回答下面的问题,答案还涵盖了在另一个 window 中打开 SSRS 详细报告所需的一切(应该适用于 ssrs-2008-r2 及更高版本)。

This would also help solve questions such as:这也将有助于解决以下问题:

SSRS relative URL SSRS 相对 URL

To answer my own question (I had some of this information from a colleague, I had to develop some myself).为了回答我自己的问题(我从一位同事那里得到了一些信息,我必须自己开发一些)。 This information is scattered all over the place, but for SSRS reports, I think that this is the only one-stop concise place that I know of:这些信息分散在各处,但对于SSRS报告,我认为这是我所知道的唯一一站式简洁的地方:

<Hyperlink>="javascript:void(window.open('" &amp; Globals!ReportServerUrl &amp; "/Pages/ReportViewer.aspx?" &amp; Globals!ReportFolder &amp; "%2fMy+Report+Name" &amp;  chr(38) &amp;  "rs:Command=Render" &amp; chr(38) &amp;   "Input1=" &amp; Fields!GoesWithInput1.Value &amp; chr(38) &amp;  "Input2=" &amp; Fields!GoesWithInput2.Value  &amp; "'))"</Hyperlink>

NOTES:笔记:

  1. Above is horizontally very long上面水平很长
  2. "My Report Name" has spaces replaced by '+' character “我的报告名称”有空格替换为“+”字符
  3. ABOVE is XML within rdl, if using the 'design' (action) in designer, you don't use the XML tags and would start with “=” ABOVE 是 rdl 中的 XML,如果在设计器中使用“设计”(动作),则不要使用 XML 标签,并以“=”开头
  4. Chr(38) is ASCII for "&" (ampersand) the & is a concat operator for the strings used within the javascript command. Chr(38) 是“&”(与号)的 ASCII,& 是 javascript 命令中使用的字符串的连接运算符。 Thus "ampersand escape" is involved and done two ways.因此,“& 符号转义”涉及并以两种方式完成。

  5. Note that this is a hodge-podge of Javascript and XML.请注意,这是 Javascript 和 XML 的大杂烩。 Since URL's are involved, http is also important (often https these days).由于涉及 URL,因此 http 也很重要(这些天通常是 https)。

  6. Finally, this is not TSQL-based and is not in the using the TSQL and the dataset.最后,这不是基于 TSQL 的,也不在使用 TSQL 和数据集。 It is possible to form URL's that way, but this solution here doesn't do it that way.以这种方式形成 URL 是可能的,但这里的解决方案不是这样做的。 I tried, and the Globals didn't seem to be available, at least in the way I tried to use them in the TSQL within the in the XML of the rdl-file.我试过了,但 Globals 似乎不可用,至少在我尝试在 rdl 文件的 XML 中的 TSQL 中使用它们的方式上。

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

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