简体   繁体   English

根据另一个参数的输入更改SSRS报告参数的值

[英]Change value of SSRS report parameter based on the input of another parameter

I have a SSRS 2005 report with three parameters: @FromDate, @ToDate and @Period. 我有一个带有三个参数的SSRS 2005报告:@ FromDate,@ ToDate和@Period。 @FromDate and @ToDate default to the first day and the last day of last month, respectively. @FromDate和@ToDate分别默认为上个月的第一天和最后一天。

The @Period parameter is a multi-value parameter. @Period参数是一个多值参数。 So if I choose for instance "Current quarter", I want the @FromDate and @ToDate to change to the corresponding values based on the input in @Period. 因此,如果我选择“当前季度”,则希望基于@Period中的输入将@FromDate和@ToDate更改为相应的值。

My problem is not getting the correct datetime expressions, but rather how to make the parameters interact with each other as desired. 我的问题不是获取正确的日期时间表达式,而是如何根据需要使参数相互交互。

To achieve your requirement, we need use cascading parameters in SSRS. 为了满足您的要求,我们需要在SSRS中使用级联参数。

In your scenario, you need create the parameter @FromDate that get values from a dataset which select FromDate based on the @Period parameter. 在您的方案中,您需要创建参数@FromDate,该参数从数据集中获取值,该数据集基于@Period参数选择FromDate。 Then create parameter @ToDate that get values from a dataset which select ToDate based on the @FromDate parameter. 然后创建参数@ToDate,该参数从数据集中获取值,该数据集基于@FromDate参数选择ToDate。

The following document is for your reference: https://technet.microsoft.com/en-us/library/aa337498(v=sql.105).aspx 以下文档供您参考: https : //technet.microsoft.com/zh-cn/library/aa337498(v=sql.105).aspx

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

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