3

I'm creating report with MS Visual Studio 2012. How to change rows width dynamically (via expression)?

Should be something like this: IFF(Visible.False) THEN (row.Height = 0)

What I'm trying to achive? I'm using expression to hide cells If they are empty. If all cells in row are empty should change row's width to 0.

This is how It looks for now (pink are hidden rows): ![hidden rows][1]


And this is how It should be:

![hidden rows should be][2]


In design It looks like:

![design][3]

As you see here are 2 rows. If [Tikrinimas2] and [Tikrinimas3] are nulls hidding first row in other way second row is hidden.

  • I think there may need to be some clarification: you write in your sample expression: IFF(Visible.False) THEN (row.Height = 0), which makes it seem like if the row is not visible, then the row height should be 0. This doesn't really make sense because if the row is not visible, it just won't appear on the report, you can't set the row height of it. Take a look at this link on changing visibility in SSRS: https://msdn.microsoft.com/en-us/library/dd220590.aspx – TPhe Mar 12 '15 at 18:38

2 Answers2

2

Rather than trying to set the row height dynamically, you can set an expression on the Hidden property of the second row in designer. Something like this:

=IIF(isNothing(Fields!Tikrinimas2.Value), TRUE, FALSE)

That should do the job for you.

mindparse
  • 6,115
  • 27
  • 90
  • 191
  • 1
    I have already done this. In this way I achieve that result which I gave you in question. Problem is that, after hidding row It brings me result as in question: `This is how It looks for now (pink are hidden rows):` I don't need to have spaces between rows after hidding. – Stanislovas Kalašnikovas Mar 13 '15 at 06:37
1

you can't change the height of a row with expressions, but you can hide rows or columns.

Check this out SSRS 2008:How to hide a table row (Conditionally) based on category field

Community
  • 1
  • 1
Rednaxel
  • 938
  • 2
  • 16
  • 33