简体   繁体   English

在SSRS中创建报告

[英]Creating a Report in SSRS

I am attempting to create a report to change Values to Red, Yellow and Green based upon the last inspection date. 我正在尝试创建一个报告,以根据上次检查日期将值更改为红色,黄色和绿色。 Inspections are every three years if DUE is in the last inspection then I want the cell to turn red, if the last inspection has been in the last 2 years I need it green and in the year that it needs and inspection I need it yellow. 如果DUE在最后一次检查中,则每三年检查一次,然后我希望电池变成红色;如果最近一次检查是在最近2年中,则我需要将其变成绿色;在需要检查的那一年中,我需要将其变成黄色。 Here is what I have NOT working :) 这是我没有工作的:)

=SWITCH(Fields!Inspection_x0020_Expires0.Value = "DUE","Red"),
(Fields!Last_Inspection.Value = "d" < 730,"Yellow")
(Fields!Last_Inspection.Value = "d" > 730,"Green")

Thank you for taking the time to help me. 感谢您抽出宝贵的时间来帮助我。

Tim 蒂姆

使用DATEDIFF函数将上次检查日期与今天进行比较。

DateDiff(DateInterval.Day, Fields!Last_Inspection.Value, Today) < 730

这就是我最终要做的事情,我添加了一个名为Textbox6的列,并使用DateDiff =DateDiff("d", Fields!Inspection_x0020_Expires0.Value, Today())计算了天数,然后获得了天数该值创建我的背景文本框颜色=Switch (Not(isNothing(Fields!Last_Inspection.Value)) and ReportItems!Textbox6.Value <= 729, "Green", ReportItems!Textbox6.Value >= 730 and ReportItems!Textbox6.Value <=1094 , "Yellow", isNothing(Fields!Last_Inspection.Value) or ReportItems!Textbox6.Value>1094, "Red" )

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

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