在 SSRS 2005 中的报告之间传递参数

发布于 2024-07-28 23:16:02 字数 547 浏览 5 评论 0原文

我对 SSRS 2005 还比较陌生。我已经构建了简单的报告和电子表格,但我才刚刚开始深入研究 SSRS/RDL 的有趣世界。 我正在尝试将一个(自定义/非查询)参数从一个报告(*.rdl)传递到另一个报告。 虽然从逻辑上讲我想添加一个全局变量,但似乎没有任何简单的方法/技术来完成我想要的事情。 似乎每个页面/报告都有自己的参数,并且报告不允许共享彼此的信息。

我试图根据用户选择的选项简单地隐藏对象/项目。 如果用户选择选项 A 或 B,我只想根据他们的选择隐藏多个报告(在同一项目内)上的某些对象。 我只是检查任何给定对象中可见性属性的表达式中的参数值。 真的没什么复杂的。 我已经对其进行了测试,仅在一个报告中,它就可以工作。 但尝试让一份报告读取另一份报告上的该值,但没有明确的途径。

现在,随着我已经习惯了 SSRS,我相信有“正常”程序员的方式,还有“SSRS”方式。 两者是互斥的。 因此,要么我试图做一些永远不会被允许的事情,这是一个“按设计构建”的功能和/或者我正在以错误的方式处理它。

有想法吗? 建议? 也许我的处理方式是错误的。

I'm relatively new to SSRS 2005. I've built simple reports, and spreadsheets but I'm just beginning to delve into the world of fun that is SSRS/RDL. I'm trying to pass one (custom/non-query) parameter from one report (*.rdl) to another. While logically I would like to add a global variable, there doesn't seem to be any straightforward method/technique for doing what I want. It seems each page/report has its own parameters and reports aren't allowed to share each other's info.

I'm trying to simply hide objects/items based on an option that the user selects. Should a user select option A or B, I want to simply hide certain objects on multiple reports (within the same project) based on their selection. I simply check for the parameter value within an expression for the visibility property in any given object. Nothing complicated really. I've tested it out and on just one report by itself, it works. But try to get one report to read that value on another report, and there's no clear path in doing so.

Now as I've grown accustomed to SSRS, I believe there's the "normal" programmer's way and then there's the "SSRS" way. Both are mutually exclusive. So either I'm trying to do something that will never be allowed, it's a "built-by-design" feature and/or I'm going about it the wrong way.

Ideas? Suggestions? Maybe I'm going about this the wrong way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情话难免假 2024-08-04 23:16:02

好的,只有几种方法可以将参数从一个页面传递到下一个页面。 我(最终)发现我只是想将布尔值从一个传递到下一个。 数据不是来自数据库,而是手动的(“真/假”)。 起初我以为我需要类似于全局变量的东西,SSRS 中有一些内置的全局变量。 但正如我发现的那样,您无法向该集合添加任何内容。

因此,在这份报告中,我有一张图像指向报告的“下一页”。 在该对象/图像中,您可以设置该对象/图像的导航参数。 到目前为止是有道理的。

在下一页上,您的报告参数必须与下一页中列出的变量的位置相匹配。 我猜 SSRS 将基于非键的数组从一个报告传递到下一个报告,因此索引/位置对于获得正确的参数至关重要。 因此,箭头允许您调整参数顺序。 这就是给我的提示,但我认为 SSRS 比 SSRS 更擅长,因为传递的参数必须只匹配名称,而不是位置。

(恕我直言)在我看来,SSRS 已经/尝试/必须保持相当静态。 没有真正意义上的事件、OO 等,但 SSRS 似乎将 VB、VBA(表达式)、SQL/T-SQL 中的元素拼接在一起,并产生了一个可用的产品。 我想这就是我的新手观点。 我确信它会随着时间而改变。

Ok, so there's a only a few ways to pass parameters from one page to the next. I (eventually) discovered that I was simply trying to pass a boolean from one to the next. The data was not from the database, it was something manual ('true/false'). At first I thought I needed something akin to a global variable which there are a few built-in globals in SSRS. But as I found out, you can't add anything to that collection.

So on this one report I have an image pointing to the 'Next' page of the report. Within that object/image, you can set navigation parameters on that object/image. Makes sense so far.

On the following page, your report parameters must match the position in which the variable was listed from the following page. I guess SSRS passes a non-key based arrays from one report to the next so index/position is vital for getting the parameters right. Hence the arrows allowing you to adjust the parameter order. That was what tipped me off, but I thought it was SSRS was more adept then that in the sense that parameters being passed had to just match in name, not position.

(IMHO) as I see things, SSRS has/tries/must remain fairly static. There's no real sense of events, OO, etc. and yet SSRS seems to stitch elements from VB, VBA (expressions), SQL/T-SQL altogether and spew forth a usable product. I guess that's my newb perspective. I'm sure it will change with time.

使用子报表可能会为您提供所需的功能。 否则,我知道将参数从一个报告“传递”到下一个报告的唯一其他方法是使用查询字符串。

Using subreports might allow you the functionality you need. Otherwise, the only other way I know of to "pass" parameters from one report to the next is using the query string.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文