CanShrink does not work with RDLC when the textbox is within a data control like Table / Matrix


ISSUE: 


As per definition, http://msdn.microsoft.com/en-us/library/ms251779.aspx


Growing and Shrinking a Text Box
By default, text boxes are a static size. If you want to expand a text box vertically based on its contents, change the CanGrow property for the text box. If you want to allow the text box to shrink based on its contents, change the CanShrink property for the text box. You can access these properties through the Properties window or through the Textbox Properties dialog box.


But when you place the textbox within a data control like TABLE / MATRIX, the CanShrink property is never honored. At the same time the CanGrow property will always work as expected.


EXPLANATION:


This is “By Design” behavior. The table row/column will not shrink below its definition height/width. This is in order to mitigate performance and memory concerns. Also the impact should be minimal, since we allow the row to grow.


You start with  a small height for the table row and let it to grow to accommodate the content.

Comments (6)

  1. ivan says:

    You workaround still does not work. As it grows all the time, even if you set row height to 0.05. Empty rows still appear at a larger height.

    The other problem with that is you can’t see what is on the report in Designer, you would need to resize it all the time, the context is not oblivious right away. So I think your "by design" is as usual done in Microsoftish way which would not accomodate real world scenarios. Why didn’t you guys just use Access report designer, which is way better. Everybody I know that says Access reports are better.

  2. Mike says:

    Not sure about Ivan’s experience that the row grows even when the text box(es) in it are empty… the workaround of making the row very small (0.001) to start with is working fine for me.

    Would agree that the Access report designer would have been a great starting point for RDLC / RDC design.

  3. Ajosph says:

    Excellent comments gentlemen…..especially

    "You start with  a small height for the table row and let it to grow to accommodate the content" !!!!!!!

    you really great

  4. Alunjd says:

    I have an issue with this as my text can be very long. and therefore I don't want to enable Cangrow ( and lose some forests)

    I wanted to set the field to about 5 rows 2cm and then allow can shrink…..

    if this is the design can we have

    1 the canshrink greyed out

    2 a Maximum size property

  5. Selvar says:

    I'm not able to understand your question. Could you please brief this a little more and explain it clearly what you're trying to achieve?

Skip to main content