简体   繁体   English

基于其他参数值的SSRS参数值无法通过LEFT使用

[英]SSRS Parameter value based on other Parameter value not working using LEFT

I have an issue with SSRS parameters. 我的SSRS参数有问题。 I have a parameter that is based on a dataset value. 我有一个基于数据集值的参数。 This parameter is called UserOffice and correctly returns value GB10. 此参数称为UserOffice,并正确返回值GB10。 I have a second parameter called IncludePrimary that returns the value of UserOffice (=Parameters!UserOffice.Value): 我有一个名为IncludePrimary的第二个参数,该参数返回UserOffice的值(= Parameters!UserOffice.Value): 在此处输入图片说明

I then change the value of the IncludePrimary expression to be the first 2 characters of UserOffice (=Left(Parameters!UserOffice.Value, 2)): 然后,我将IncludePrimary表达式的值更改为UserOffice的前2个字符(= Left(Parameters!UserOffice.Value,2)): 在此处输入图片说明

I expected the field to show GB. 我希望该字段显示GB。 Can someone please tell me what I am doing wrong? 有人可以告诉我我做错了吗?

Thanks Rob 谢谢罗布

A parameter (your second one) isn't "updated" (the default value isn't re-applied) while the currently selected value(s) is (are) still in the list of available values after other parameters have been changed. 在更改其他参数后,当前选择的值仍在可用值列表中,但不会“更新”参数(第二个参数)(不会重新应用默认值)。

To update the second parameter, you must not only change its Default Value but will need to set its Available Values as well: 要更新第二个参数,您不仅必须更改其默认值,而且还需要设置其可用值:

可用值

Or, of course, you can simply use your expression Left(Parameters!UserOffice.Value, 2) whenever you need it, so you don't need that second parameter at all. 或者,当然,您可以在需要时仅使用表达式Left(Parameters!UserOffice.Value, 2) ,因此根本不需要第二个参数。

Thanks to everyone who replied. 感谢所有答复。 They responses were very helpful. 他们的回答非常有帮助。 In order to resolve my issue I created a second dataset that calculated the default value (Y or N). 为了解决我的问题,我创建了另一个计算默认值(Y或N)的数据集。 I used set Available Values and then used my new dataset to set the default. 我使用了“设置可用值”,然后使用新的数据集设置了默认值。

It works a treat. 它可以治疗。

Rob

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

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