保存的搜索条件HTML格式 [英] Saved Searches Conditional HTML Formatting

查看:172
本文介绍了保存的搜索条件HTML格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据特定条件突出显示/指示已保存的搜索列中的各个字段.我不想突出显示特定的行,因为它将突出显示整个行,而不仅仅是单个列.

I'm trying to highlight/indicate individual fields within a saved search column based on a certain criteria. I don't want to highlight the specific row as that will highlight the entire row and not just the single column.

我现在的基本代码是

CASE WHEN {custbody487} = 'On Time' 
THEN {custbody487}
ELSE CASE WHEN {custbody487} = 'On Hold' 
THEN {custbody487}
ELSE CASE WHEN {custbody487} = 'Late' 
THEN {custbody487}
END END END

如何有条件地仅突出显示特定列?我想将按时间"突出显示为绿色,将保持"突出显示为蓝色,等等.但是我只想突出显示该特定列中的文本.

How do I conditionally highlight only a specific column? I want to highlight On Time as green, On Hold as blue, etc. But I only want to highlight the text in that specific column.

推荐答案

您可以将HTML格式添加到保存的搜索中.

You can add HTML formatting to saved searches.

确保在结果下使用公式(文本). 上面的代码如下所示.

Make sure you're using Formula(text) under results. Here's what the above code looks like highlighted.

 CASE WHEN {custbody487} = 'On Time' 
    THEN '<span style="color:green;font-weight:bold">' || {custbody487} || '</span>' 
    ELSE CASE WHEN {custbody487} = 'Late' 
    THEN '<span style="color:red;font-weight:bold">' || {custbody487} || '</span>' 
    ELSE CASE WHEN {custbody487} = 'On Hold' 
    THEN '<span style="color:blue;font-weight:bold">' || {custbody487} || '</span>' 
END END END

请注意,以这种方式保存的搜索在导出为PDF或CSV时不会保留其HTML格式.它将被格式化为纯文本.

Be advised that searches saved this way will not keep their HTML formatting upon export to PDF or CSV. It will be formatted as plain text.

这篇关于保存的搜索条件HTML格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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