How to collapse a row in RDLC rather than just hide it?
Asked Answered
D

3

6

I have an RDLC report showing a table. A certain row in this table should not appear in some conditions apply. I was able to set the Hidden property to false using an expression if these conditions apply.

The problem is that, though hidden, the row is still taking place in the table, i.e. it is not collapsed.

How can I collapse it rather than simply hide it?

I am using RDLC with report viewer 2010 SP1

Divers answered 20/9, 2011 at 17:40 Comment(1)
Mark the correct answer for others to find. The second one with the toggle item does the trick. Setting hidden as the marked answer suggest does not workTybi
A
-2

Check this solution

set Hidden property to True or False

= (Fields!UserName.Value.ToString() = "")

Also check expression examples

Hope this answer help you.

Adulterous answered 20/9, 2011 at 17:45 Comment(4)
I have seen this solution at #628147 but the point is not setting hidden to true. it is to collapse the row so it does not occupy any space in the table.Divers
You just need to set the hidden property true or false and the required line needed to be set it will work.Adulterous
This not work, the correct answer is from @PokeweedAlter
yah scroll down for the correct answer of @PokeweedAlleyne
P
25

Despite the insistance that their solution works, the Hidden property still makes the row take up space. No big deal if it is the last row, but when it is between rows it can be a big deal. And Can Shrink is no help either. The solution to collapse the row is the right-click the row header and select Row Visibility..., then enter the expression that will evaluate to true or false.

Pokeweed answered 8/4, 2013 at 15:32 Comment(1)
Row visibility worked for me, this should be marked as the correct answer.Stalky
V
3

Make sure that CanShrink is set to true.

Vertievertiginous answered 6/8, 2012 at 15:48 Comment(0)
A
-2

Check this solution

set Hidden property to True or False

= (Fields!UserName.Value.ToString() = "")

Also check expression examples

Hope this answer help you.

Adulterous answered 20/9, 2011 at 17:45 Comment(4)
I have seen this solution at #628147 but the point is not setting hidden to true. it is to collapse the row so it does not occupy any space in the table.Divers
You just need to set the hidden property true or false and the required line needed to be set it will work.Adulterous
This not work, the correct answer is from @PokeweedAlter
yah scroll down for the correct answer of @PokeweedAlleyne

© 2022 - 2024 — McMap. All rights reserved.