简体   繁体   English

如何在SSRS中使用十六进制颜色值

[英]How to use hex color value in SSRS

When I set custom color to some form in Expressions window, the formula looks like #117be0 or ="#117be0" 当我在“表达式”窗口中将自定义颜色设置为某种形式时,公式看起来像#117be0="#117be0"

So, the question is, how to get string color hex value from dataset that contains the same value? 因此,问题是,如何从包含相同值的数据集中获取字符串颜色十六进制值? Something like this =First(Fields!my_color.Value, "color_dataset") 像这样=First(Fields!my_color.Value, "color_dataset")

Well, you kind of answered your own question. 好吧,您回答了自己的问题。 Yes, FIRST() will return the first value in the colors dataset. 是的,FIRST()将返回颜色数据集中的第一个值。 To make this more meaningful, you are going to want to used the LOOKUP function. 为了使它更有意义,您将要使用LOOKUP函数。

LOOKUP(Fields!Local_Dataset_Value.Value, Fields!Color_Dataset_Value.Value, Fields!my_color.Value, "color_dataset") LOOKUP(字段!Local_Dataset_Value.Value,字段!Color_Dataset_Value.Value,字段!my_color.Value,“ color_dataset”)

Lookup will check the value of the Local_Dataset_Value field in your current table dataset, and find a match for that value in the "color_dataset" dataset's Color_Dataset_Value field. 查找将检查当前表数据集中的Local_Dataset_Value字段的值,并在“ color_dataset”数据集的Color_Dataset_Value字段中找到该值的匹配项。 When it finds a match, then your color will return. 找到匹配项后,您的颜色将恢复。

To explain further, given datasets: 为了进一步解释给定的数据集:

Dataset1 数据集1

Name | 姓名| Age | 年龄| Etc 等等

........................ ...........................

Joe | 乔| 30 | 30 | Whatever 随你

and

color_dataset color_dataset

Color_Name | 颜色名称| my_color my_color

..................... .....................

Joe | 乔| Blue 蓝色

then: 然后:

LOOKUP(Fields!Name.Value, Fields!Color_Name.Value, Fields!my_color.Value, "color_dataset") LOOKUP(Fields!Name.Value,Fields!Color_Name.Value,Fields!my_color.Value,“ color_dataset”)

Would return: 将返回:

"Blue" “蓝色”

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

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