SSRS 2005 - 级联参数和默认值更新问题
我有一份带有级联参数的报告。第一个参数是财务周期类型,可以是月或周。第二个参数是财务月份或财务周的列表,具体取决于为第一个参数选择的内容。这一切都运行良好,并且按顺序选择一系列不同的财务周期类型可以正确更新第二个参数的值。
不过,我现在希望为第二个参数添加默认值,该值再次依赖于第一个参数。因此,我向数据集添加了一个附加字段,用于填充名为 DefaultPeriod 的第二个参数,并将第二个参数的默认值设置为从上述字段中检索。
我第一次选择财务周期类型时,默认设置正确。但是,更改财务周期类型会导致第二个参数的列表更新,但默认值不正确。即使数据集已刷新并且 DefaultPeriod 字段正确,它仍然设置为原始默认值。
这既是 IDE 中的问题,也是报表管理器站点上的问题。
I have a report with cascading parameters. The first parameter is Finanical Period Type, being either Month or Week. The second parameter is a list of either financial months or weeks depending on what was selected for the first parameter. This all works well and selecting a series of different Financial Period Types in sequence correctly updates the second parameter's values.
However I now wish to add a default value for the second parameter, which is once again dependent on the first parameter. So I've added an additional field to the dataset populating the second parameter called DefaultPeriod and set the second parameter's default value to be retrieved from the above field.
The first time I select the Financial Period Type, the default is correctly set. However changing the Financial Period Type results in an updated list for the second parameter, but the default is incorrect. It remains set to the original default value, even thought the dataset has been refresh and the DefaultPeriod field is correct.
This is both an issue in the IDE and on the Report Manager site.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 JC 提到的,默认值并不总是会刷新。但如果您确实需要刷新级联参数,实际上有一个解决方法。诀窍是每次父级值更改时使级联参数的选择无效。
有关更多详细信息,请参阅 Boyan Penev 撰写的以下文章: http://www.bp-msbi.com/2011/04/ssrs-cascading-parameters-refresh-solved/
As JC mentioned, the default does not always get refreshed. But there is actually a workaround if you really really need the cascading parameters refreshed. The trick is to invalidate the selection of the cascading param each time the parent's value changes.
For more details, have a look at the following article by Boyan Penev: http://www.bp-msbi.com/2011/04/ssrs-cascading-parameters-refresh-solved/
不幸的是,即使底层数据集发生变化,默认值也只能确定一次。唯一的解决方案是在第二个列表的每个版本中都有一个特殊选项。假设它是字符串参数,我将其称为“默认”,值为“-default-”,在使用数据集中的值之前,我会检查“-default-”的值并将其转换为任何值基于第一个参数的值的适当的默认值。
我知道这很复杂,但这是我发现解决问题的唯一方法。
Unfortunately the default gets determined only once, even if the underlying dataset changes. The only solution is to have a special option in every version of your second list. Assuming it's string parameter, I'd call it "Default" with a value of "-default-" and before using the value in a dataset, I'd check for the value of "-default-" and translate that into whatever is the appropriate default value based on the value of the first parameter.
I know it's convoluted, but it's the only way I've found to get around the problem.