Dynamic Coloring of Cells based on the Muti-Value Selection

  • Hello All,

    I am working on a report where in I need coloring of cells based on a Multivalue drop down selection.

    Scenario:

    1.) I have a exception flag as a column/field in the database which list the postion of the Exception and also the Value of the exception.

    Example: ExcpFlag: 012024504213

    Each digit in this ExcpFlag represents two values 0 being the first column in the table and 0 is Good data. 1 being the 2nd column and 1 is null data. 2 is 3rd column and Missing SSN...etc.

    We have separate list table which list all the exceptions with key and value pairs.

    ExcpTable has 0 | GoodData

    1 | NullData

    2 | Missing SSN's and etc.

    2.) The Stored Procedure brings me the records based on the exception flag and file ID.

    Example: Two Parameters to SP.

    Exec sprcFileException fileID:'1025' and ExcpFlag: '0,1,3,7,9' gives me all the records for that FileID and also the ExcpFlag.

    3.) Now what I need is: Dynamic Coloring of the cells which has only '0,1,3,7,9' in the report for the fileID: 1025.

    I have about 24 fields/columns in the report and data displays for only '0,1,3,7,9' exception types from the selction.

    Problem: I want to color all the cells which have the '0,1,3,7,9' exceptions on the report.

    Please help me figuring out this issue.

    Thanks in Advance.

    Deepak

  • Please help me.

  • Hi DEEPAK,

    As per my understanding, you want to apply colors to all fields on a report where the exception is '0,1,3,7,9' ..

    As you have a seperate column to display these exception codes..so...select the row on your report and just apply

    IIF expression as on background color property...

    =IIF(Fields!ExpressionsCode.Value = '1',"Red","Green")....This will test just for one exception code...i.e. 1

    If you have multiple exception codes..so you can use Choose or Switch..

    =Switch(Fields!ExpressionsCode.Value = '1',"Green",

    Fields!ExpressionsCode.Value = '3',"Red")....etc etc...

    Did you try this...or you want it to b some other way round...?? πŸ™‚

    Thanks,

    Niraj

  • Thanks for the Input Niraj.

    By implementing the switch or IIF I am restrting the codes to the specified numbers. And also I have to do the same thing over and over again for all the columns in the report. If there is any change in the table to add extra exception , then I have to come back to the report and do that change to all the columns.

    If I select the Multi-values and then click ViewReport btn, then the columns which have those exceptions only have to be colored/identified.

    Hope this explains well..

    Deepak

  • Hii DEEPAK..

    Well..we have one more option..

    For applying Colors to whole report items / records without specifying it for the particular row or record name….We should use

    Switch(Me.Value <> β€œ1”,”red”,Me.Value <> β€œ3”,”green”.....etc etc).

    This will apply colors to whole table and later if you want to make any changes...then you can easily modify it..

    (This expression you can use for Background color property or Forecolor property...)

    You can try this...and let me know..if it's useful to you..?? πŸ™‚

    Cheers,

    Niraj

  • Small enhancement:

    Since this'll be used in multiple places and could easily need changes or updates in the future, add some custom code to the report. (Report/ReportPropertyies..., Code tab).

    Then call this from the background, passing the required fields / values.

    This way, you can implement complex logic easily, and have one place to do updates.

Viewing 6 posts - 1 through 5 (of 5 total)

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