英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论