none
SSRS Report Coulm Hiding

    Question

  • I want hide a column in SSRS report based on the Field value, the field value may differ, but in one detail it will be unique.

    If the field value is 'A' i want to hide 'col1', in the second detail field value may be 'B', in that case the coumn should be visible. When i tried to write expression in column visibilty , it didnt work, it only works when all the records have the value 'A'.

    Wednesday, November 06, 2013 7:04 AM

All replies

  • Hello ,

      I couldn't get the requirement clearly from your explanation. But if you are looking for expression to show or hide column based on the distinct values in the column try the below

    =IIF(CountDistinct(Fields!name.Value) = 0,True,False)

    If this doesn't work , please provide as more details with sample data and screen shots (preferably) to get further faster assistance.


    Best Regards Sorna

    Wednesday, November 06, 2013 7:28 AM
  • So are you telling that at the same detail level you want a column to be shown in some cases and hidden for the other? 

    If yes, that not possible. you can only blank the column contents or show it based on your condition but column will always be present.

    If its in a different level then its possible based on value of field in parent group.

    Wednesday, November 06, 2013 8:01 AM

  •        Name |  Age | Sex | Time IN | Time OUT

            anil       23       M                          


           In this case if the dataset field value have Field Say TimeSelected = AM, then need to show only Time IN column, if TimeSelected = PM then need to show only Time OUT coulmn, if TimeSelected = Both , need to show both column.

    In the column visibilty of Time IN i write like below

    =IIF(Fields!TimeSelected .Value = "PM",True,False)

    In the column visibilty of Time OUT i write like below

    =IIF(Fields!TimeSelected .Value = "AM",True,False)


    It will work only if all have TimeSelected AM only or PM only , When mixed with AM and PM and Both, column was not hiding.


    Wednesday, November 06, 2013 10:30 AM
  • And the report is grouped by TimeSelected
    Wednesday, November 06, 2013 11:24 AM
  • How do you select field from AM or Pm or both? Do you mean Report Parameter?

    If so, you need to change the visibility criteria from field to parameter.

    Try to change your visibility expression something like

    =IIF(Parameter!TimeSelected.Count = 1 AND Parameter!TimeSelected.Value = "PM",True,False)  for Time IN and =IIF(Parameter!TimeSelected.Count = 1 AND Parameter!TimeSelected.Value = "AM",True,False)  for Time OUT

    Wednesday, November 06, 2013 4:06 PM
  • Time Selected is a dataset filed value
    Thursday, November 07, 2013 3:35 AM
  •    Name |  Age | Sex | TimeSelected | Time IN

       anil       23       M       AM

      Name |  Age | Sex | TimeSelected | Time IN | Time OUT
       anil       23       M       Both

      Name |  Age | Sex | TimeSelected | Time OUT
       anil       23       M      PM

       This is my requirement. Which is grouped by TimeSelected

    Thursday, November 07, 2013 3:38 AM