In SQL Server Reporting Services, how do I limit Previous function's scope to a group?
I am working on a report that gets, for example purpose, 5 columns from database.
Lets say ProductionCountry, Industry, ProductGroup, ProductId, Price. I am grouping them on ProductionCountry, Industry and ProductGroup. Visually its like this.I have applied this expression to hide repetition of a group's column data
=Previous(Fields!IndustryName.Value) = Fields!IndustryName.Value
But the problem with that is, this expression considers previous value from previous group.
If you can see the 2 red boxes in the image for Taiwan, I would like to show Hardware and LCD Panels in Industry and ProductGroup columns respectively. But the expression would hide it.
Any one knows how to开发者_如何转开发 fix it?
You need to check more than one criteria as you go down the hierarchy of values so you'll need three Visibility-Hidden expressions:
For ProductionCountry:
=Previous(Fields!ProductionCountry.Value) = Fields!ProductionCountry.Value
For Industry:
=Previous(Fields!ProductionCountry.Value) = Fields!ProductionCountry.Value AND Previous(Fields!IndustryName.Value) = Fields!IndustryName.Value
For ProductGroup:
=Previous(Fields!ProductionCountry.Value) = Fields!ProductionCountry.Value AND Previous(Fields!IndustryName.Value) = Fields!IndustryName.Value AND Previous(Fields!ProductGroup.Value) = Fields!ProductGroup.Value
精彩评论