[{"id":"bcb0874d-299b-448e-9552-9e9b25ef80dd","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8ce3627e-9e58-471b-9133-4f135d191e7b","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"ae60ae59-34f5-4f32-a8eb-243ed1457543","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3d4848c3-910f-4ffa-9153-60bb507334a9","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"133f4ca6-d951-4d65-a618-3dc6301266f7","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"de62ec1c-813e-40b1-8160-a4cd109afe64","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2426c71d-8332-4cbd-a436-1ec4f8666464","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2ce7b6b0-78aa-4e4b-bf8a-e4ba2f988298","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"4706db46-0811-4652-8f59-1e0a1da84758","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8f1271bb-2cd9-4f39-9897-c15b239ee7ab","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"677e13a7-6f3e-449f-986c-2c3a26f8d54f","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"5e40f6dc-caec-49d7-a1d0-be65f06815ba","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2457f0e0-9e71-4860-a87d-065e0fb84f84","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"d5c67fd0-1145-482c-9113-97b492c44c18","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"a609a8fa-ab91-4c1d-a1c3-d209d0463303","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"b4a9eb15-94e5-48df-b218-a24138f0cf9c","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]}]
        
(Showing Draft Content)

条件格式化的典型场景:前景色和背景色

功能概述

在表格类报表中,成片的数字往往给人“找不到重点”的感觉,如下图:

093737obr9yoobv6xyonhn.png

这是一个全国各大区域与不同支付方式的销售交叉分析,就是对比分析每个大区、不同支付方式的订单总额情况。

由于整个表格大部分都是数字,实际很难一眼看出什么地区的哪种支付方式的订单比较多。

如果将低于某个数量的数字显示为红色,高于某个数量的数字显示为绿色,无疑将有助于判断哪些地区的哪种支付方式的订单多寡。

这种根据条件来设置报表内容颜色的设计,就叫条件格式化。当然格式化还包括字体、框线等多种样式的设置,只是颜色的设置更为普遍。

颜色分为前景色和背景色,报表的颜色设置,允许使用表达式。在表达式中使用IIF函数,根据条件设置几种不同的颜色,即可实现条件格式化。

前景色设置

报表的前景色通过字体颜色来设置。如下图:

image


将【颜色】设置为下面的表达式:

 {IIF(Sum(购买数量) < 100, "Red", IIF(Sum(购买数量) < 200, "Black", "DarkGreen"))} 

其含义是:

如果购买数量合计小于100,那么显示红色(Red),否则如果大于等于100、小于200,显示为黑色(Black);大于等于200,则显示为深绿色(DarkGreen)。

IIF函数支持嵌套,因此可以设置任意多个颜色条件。

预览效果:

image2020-11-6_11-47-31.png

背景色设置

报表本身、表格整体、表格单元格,都支持背景颜色的设置,但是这里是为了突出显示需要关注的表格数字,因此应设置表格单元格的背景颜色,如下图:

image


将背景颜色设置为下面的表达式:

{IIF(Sum(购买数量) > 600, "LightGreen", "Transparent")}

其含义是:

如果购买数量合计大于600,那么将背景设置为亮绿色(LightGreen),否则设置为透明(Transparent)。

报表预览效果如下图:

105219lpvnzr2zj7kdlbml.png

可以直观地看到:西北地区的支付宝方式的订单数量最多,而西南地区的其他支付方式的订单数量最少。

除了颜色,报表设置也支持将字号、字形、特殊效果、对齐方式等选项设置为表达式,从而可以实现更为丰富的条件格式化,如下图:

image2020-11-6_11-55-43.png