Search code examples
reporting-servicesssrs-2008ssrs-tablixssrs-grouping

remove the empty white space in previous expression in ssrs report


What I need is, when comparing the previous record value with current field, if it is true, it must hide the field value, otherwise show the field value.

All is working fine... but the empty white space is displayed when the field is hidden. I do not want the white space in cell. How can I collapse this?

This is the expression used:

=IIF(Fields!GPIDrugGroupName.Value = Previous(Fields!GPIDrugGroupName.Value),"",Fields!GPIDrugGroupName.Value)

Solution

  • You need to set the row Row Visibility to be expression-based using the Previous function, not the Textbox expression.

    Say you have a simple Dataset, and a simple Table based on this:

    enter image description here

    enter image description here

    The expression is the same as the expression in your question.

    This gives the blank row you're seeing:

    enter image description here

    As above, you need to set the Row Visibility to be expression-based:

    enter image description here

    enter image description here

    In my example the expression is:

    =IIF(Fields!GPIDrugGroupName.Value = Previous(Fields!GPIDrugGroupName.Value)
      , True
      , False)
    

    Which now gives what I think is the required result:

    enter image description here

    The other consequence is that you can remove the expression from the Textbox and just reference the field directly.