简体   繁体   English

使用列值的SSRS过滤器

[英]SSRS Filter using Column Value

I have two columns in a dataset LABELSTRING and FIELDVALUE namely. 我在数据集LABELSTRINGFIELDVALUE有两列。 The sample values are as follow. 样本值如下。

LABELSTRING FIELDVALUE
--          -- 
FIRSTNAME   ALEX
LASTNAME    FERGIE
CITY        MANCHESTER

Now I need to get the values of FIRSTNAME , LASTNAME & CITY in my report and present them in a text box. 现在,我需要在报告中获取FIRSTNAMELASTNAMECITY的值,并将其显示在文本框中。 Is there any way I can do it. 有什么办法可以做到吗? I am pretty new to this stuff. 我对这些东西很陌生。

Thanks 谢谢

One option is to change your dataset query so that FIRSTNAME, LASTNAME, and CITY are the names of the columns and there is 1 row returned with the values. 一种选择是更改数据集查询,以使FIRSTNAME,LASTNAME和CITY为列的名称,并返回1行及其值。 Then in a textbox you could use a formula like this: 然后,您可以在文本框中使用如下公式:

=First(Parameters!FIRSTNAME.Value, "DataSet1") + " " + First(Parameters!LASTNAME.Value, "DataSet1") + " " + First(Parameters!CITY .Value, "DataSet1")

Another option is to keep the existing dataset and use calculated fields to get the values you need. 另一个选择是保留现有数据集并使用计算所得的字段来获取所需的值。 This method is a little more messy, but can be useful in more complex situations. 这种方法比较混乱,但是在更复杂的情况下可能很有用。 First you add a calculated field using an expression like this: 首先,您使用类似以下的表达式添加计算字段:

=iif(Fields!LABELSTRING.Value = "FIRSTNAME", Fields!FIELDVALUE.Value, Nothing)

Then, in the textbox you can refer to them like this: 然后,在文本框中可以像这样引用它们:

=Max(Parameters!CALCULATED_FIRSTNAME.Value, "DataSet1")

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

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