简体   繁体   English

SSRS:有条件地更改文本框某些项目的字体颜色

[英]SSRS: Conditionally change font color of certain items of a textbox

I've searched for an answer to this issue before, and found another way to get what I needed, but was curious if this was actually a possibility. 此前,我一直在寻找该问题的答案,并找到了另一种获取我所需要的方法的方法,但好奇是否确实存在这种可能性。 Is there a way to change the font color of a single word in a textbox when the word is part of an expression? 当单词是表达式的一部分时,是否可以更改文本框中单个单词的字体颜色? I know that if you have a text box with the words "This is red" then you could highlight the word red, and change the font color that way, but when you are using an expression to generate the text, you really don't get that option. 我知道,如果您有一个带有“ This is red”字样的文本框,则可以突出显示红色字样,并以这种方式更改字体颜色,但是当您使用表达式生成文本时,您实际上不会得到那个选择。 Is this maybe doable using custom code? 使用自定义代码可能可行吗?

This can be done in two different ways: 这可以通过两种不同的方式完成:

  • Break the text up into multiple placeholders. 将文本分成多个占位符。 You can control the color of each placeholder independently. 您可以独立控制每个占位符的颜色。 A textbox can contain as many placeholders as you like. 一个文本框可以包含任意多个占位符。
  • place the formatting in-line as HTML codes such as "This can have one word in <span style='color:red'>red</span>." 将格式设置为HTML代码,例如"This can have one word in <span style='color:red'>red</span>."

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

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