首页 > 解决方案 > 如果字体是 SSRS 中最近 5 年的最小值或最大值,则突出显示字体

问题描述

我在 SSRS 中创建了一个矩阵来显示过去 5 年不同产品的订单数量。我想根据去年的总订单设置 products 字段的字体颜色。例如,如果去年的订单量是过去 5 年内记录的最高订单量,我希望字体为“绿色”。如果订单数量是过去 5 年中最低的,则为“红色”。如果订单数量既不是最低也不是最高则黑色。

我试过使用这个博客的例子。

www.bigator.com/2012/04/26/spothighlight-minimum-and-maximum-values-in-each-row-in-matrix-report-in-ssrs/

我已经修改了表达式以包含我的案例的年份,但它不起作用。

有什么我想念的吗?

有人可以帮忙吗。

这是我为字体颜色尝试过的表达式。

=SWITCH((Fields!OrderQuantity.Value=ReportItems!MaxQty.Value) and (Fields!CalendarYear.Value="2007"),"Green",
        (Fields!OrderQuantity.Value=ReportItems!MinQty.Value) and (Fields!CalendarYear.Value="2007"),"Red",
        (((Fields!OrderQuantity.Value<ReportItems!MaxQty.Value) and (Fields!CalendarYear.Value="2007")) OR
        (Fields!OrderQuantity.Value>ReportItems!MinQty.Value) and (Fields!CalendarYear.Value="2007")),"White")

我希望产品类别字体为“绿色”,因为 2007 年的订单量最高。但它不工作。

标签: reporting-services

解决方案


推荐阅读