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)
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:
The expression is the same as the expression in your question.
This gives the blank row you're seeing:
As above, you need to set the Row Visibility to be expression-based:
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:
The other consequence is that you can remove the expression from the Textbox and just reference the field directly.