Crystal Report – 文本颜色更改

huangapple go评论69阅读模式
英文:

Crystal Report - text colour change

问题

我正在使用一个包含描述文本(字符串对象)的公式字段。
如果文本的描述部分包含特定值,我想要更改字体颜色。
例如,Brisbane Exhibition Centre - 如果描述中包含“Exhibition”字样,那么颜色应该是红色。

目的是突出显示具有特定单词的文本,这类似于我们在Excel中使用条件公式“文本包含”并更改颜色为红色。

Kind Regards,
Mudit

我尝试使用like运算符添加公式来更改字段,但没有帮助。

英文:

I am using a formula field that has a description text (string object).
I would like to change the font colour if the description of the text contains partial value.
eg. Brisbane Exhibition Centre - if the description has "Exhibition"word then colour should be red.

The intention is to highlight a text that has a specific word, this is similar when we do this in excel in conditioning formula "Text that contains "and chagne colour to RED.

Kind Regards,
Mudit

I tried changing field with adding formula using like operator but did not help.

答案1

得分: 0

右键点击公式字段,选择“格式化字段”,选择“字体”选项卡,然后选择设置“颜色”属性的按钮。例如:

IF instr(CurrentFieldValue, "展览") > 0 Then crRed
Else IF instr(CurrentFieldValue, "会议") > 0 Then crRed
Else crBlack
英文:

Right-click the formula field, Format Field..., select Font tab and select the button to set an expression for the Color property. For example:

IF instr(CurrentFieldValue, "Exhibition")> 0 Then crRed
Else IF  instr(CurrentFieldValue, "Conference") > 0 Then crRed
Else crBlack

huangapple
  • 本文由 发表于 2023年5月18日 08:47:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76277059.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定