基于日期范围的SSRS报告中文本框的有条件颜色编码

发布于 2025-02-12 04:59:15 字数 398 浏览 0 评论 0原文

我的报告主体中有以下列,我需要根据以下条件填充providernextcontactdate文本框中的背景颜色

ProviderContactDate    ProviderNextContactDate
  2/3/2022               8/3/2022
  1/6/2022               7/6/2022
  11/18/2022             5/18/2022

if ProviderNextContactDate is past due then Red
if ProviderNextContactDate is within 30 days then yellow
otherwise transparent

I have below columns in my report body and I need to fill background color in a ProviderNextContactDate textbox based on below condition

ProviderContactDate    ProviderNextContactDate
  2/3/2022               8/3/2022
  1/6/2022               7/6/2022
  11/18/2022             5/18/2022

..

if ProviderNextContactDate is past due then Red
if ProviderNextContactDate is within 30 days then yellow
otherwise transparent

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

归途 2025-02-19 04:59:15

假设过去的到期时间是在今天或更早的时间您的colems datedateTime数据类型,然后只设置backgroundColor < /code> textbox的属性类似于表达式...

=SWITCH(
        Fields!ProviderNextContactDate.Value >=Today(), "Red",
        DateDiff("d", Fields!ProviderNextContactDate.Value, Today()) <=30, "Yellow",
        True, Nothing
       )

最终的“ true”就像其他相似。 “ Nothing”是文本框的默认背景色,这实际上是透明的。

您可能需要调整天数或&gt; =&lt; =依靠您的需求。例如,日期返回交叉的边界数,在这种情况下,天数(由“ D” d“表示)。

Assuming past due means past on or earlier than today and your colums are Date or DateTime data types, then just set the backgroundcolor property of the textbox to an expression something like this...

=SWITCH(
        Fields!ProviderNextContactDate.Value >=Today(), "Red",
        DateDiff("d", Fields!ProviderNextContactDate.Value, Today()) <=30, "Yellow",
        True, Nothing
       )

The final 'True' acts like an else. 'Nothing' is the default backgroundcolor for textboxes which is effectively transparent.

You may need to adjust the numbers of days or the >= and <= depnding on your needs. For example, DateDiff returns the number of boundaries crossed, in this case the number of days (denoted by the "d").

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文