changing color of the record

  • I have this function

    dt1,dt2 are 2 dates which r coming as string

    if dt2,today's date diff>6 months then Red else dt2 is null then check with dt1,today's date diff>6 months then Red

    Public Function GetColor(ByVal dt1,ByVal dt2) As String

    IF DateDiff(DateInterval.Month,Date.Now, CDate(dt2) ) >=6 Then

    Return "Red"

    Else IF isDBNull(CDate(dt2)) AndAlso DateDiff(DateInterval.Month,CDate(dt1), Date.Now ) >=6 Then

    Return "Red"

    Else

    Return "Black"

    END IF

    End Function

    =code.GetColor(Fields!ActsDate.Value,Fields!DecisionDate.Value)

    Please help me..

    thanks in advance

  • I assume you're talking about doing this in Reporting Services.

    Click on the detail row. On the far left, just to the left of the report, right-click on the box beside the detail row and select properties. Set the "BackgroundColor" to this expression, and that's it.

    Here's a link to some good examples.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply