当值更改时更改列的字体颜色 [英] Change font color for a column when the value changes

查看:65
本文介绍了当值更改时更改列的字体颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一列的值在行中重复,并且我想在值更改时更改字体的颜色,我该怎么做?

if i have a column where the values are repeated across rows and i want to change the color of the font when the value changes, how do i do this?

推荐答案

您可以定义字体颜色的表达式.在 Visual Studio/商业智能中:

You can define an expression for the font color. In Visual Studio/Business Intellligence:

  1. 选择要更改字体颜色的单元格
  2. 导航到属性中的颜色列表,然后选择它
  3. 单击当前设置的值(通常为黑色)旁边显示的下拉箭头
  4. Web 选项卡下,选择表达式(列表顶部)- 将出现编辑表达式"对话框
  5. 您可以将 IIF 与 PREVIOUS 函数结合使用 比较值.IE:

  1. Select the cell you want to alter the colour of the font in
  2. Navigate to the Color listing in the Properties, and select it
  3. Click the Dropdown arrow that appears next to the value it's current set to (typically Black)
  4. Under the Web tab, select Expression (top of the list) - the Edit Expression dialog will appear
  5. You can use the IIF in combination with the PREVIOUS function to compare values. IE:

=IIF(Fields!Registrations.Value <> Previous(Fields!Registrations.Value), 
      "Black", 
      "Blue")

如果为真,这个表达式会将字体涂成黑色——如果为假,则为蓝色.

If true, this expression will colour the font black -- if false, blue.

这篇关于当值更改时更改列的字体颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆