none
Conditional formatting of the group depends on a field of all associated lines

    Question

  • Hello,
    I want a group field as red represent, if included in a particular text box the value DL *.

    Example of the Dataset:

    Productname | Price | Text
    A                  | 01    | ABC
    A                  | 02    | DL-123

    Now, the Field Productname should be RED in the Group Row.
    If tried with: =iif(Fields!SalesLine.Text.Value like "DL*","RED","BLACK")
    but this only works if the first detail line contains the value ABC in the TextBox TEXT.How can i solve this Problem. thanks

    Wednesday, August 20, 2014 12:04 PM

Answers

All replies

  • Hi,

    hope it helps

    =iif(InStr("DL-123","DL")=1,"RED","Black")


    http://gnanadurai.blogspot.in/

    Wednesday, August 20, 2014 6:36 PM
  • Unfortunately not. It only works if the first detail row of this group includes this "DL". But if, for example, is in the second or third detail row of the group then it does not work.
    Thursday, August 21, 2014 6:50 AM
  • Hi ,

    You can try any of below;

    =IIf(Fields!SalesLine.Value.IndexOf("DL") >= 0,"Yellow","Transparent")
    =IIf(Fields!SalesLine.Value.Contains("DL"),"Yellow","Transparent")
    
    For uppercase  Value
    =IIF(InStr(UCASE(Fields!SalesLine.Value),"DL"))>0, "Yellow", "Transparent") 
    For Lower case  Value
    =IIF(InStr(Fields!SalesLine.Value,"DL")>0, "Yellow", "Transparent")
    
    Thanks

    Thursday, August 21, 2014 7:04 AM
  • No it doesn´t work. It´s the same result.

    Maybe I did not explain the problem properly. Therefore I have now attached a screenshot.
    At the date 15.4.2014 it works but the date 06.06.2014 it does not work. Since the field in the group is not formatted.


    • Edited by stony17 Thursday, August 21, 2014 7:34 AM
    Thursday, August 21, 2014 7:33 AM
  • Hi stony17,

    According to your description, you want to set the text color in parent group based on the values in child group. Right?

    In Reporting Services, if you want to use conditional expression for parent group based on the values in its child group, it will only compare the first row in the child group because compared field is not in the same scope as the parent group field. In this scenario, we need to add a calculated field: =IIF(Fields!Text.Value like "DL*","Red","Black"). Then we can use sum() function on this field and specify the parent group as the scope. So we can set the text color based on this sum result. We have tested this scenario with sample data in our local environment. Here are screenshots for your reference:

    If you have any question, please feel free to ask.

    Best Regards,
    Simon Hou

    Thursday, August 21, 2014 8:52 AM
    Moderator
  • This work´s.

    Thank you very much.

    • Marked as answer by stony17 Thursday, August 21, 2014 9:27 AM
    Thursday, August 21, 2014 9:27 AM
  • Please Mark as answer to the reply that work for you .

    So the user will able to recognize the answer for there use if they face same issue.

    Thanks

    Thursday, August 21, 2014 10:23 AM