By default, when the contents of a textbox in SSRS overflows the width of the textbox, the textbox will grow vertically to accommodate its content. This feature can be turned off, by setting the "CanGrow" property of the textbox to "False".
However, this abruptly cuts off the content, which is not ideal.
I am looking for a way to clearly show the user that the text is too wide to fit the textbox. In the past, I've been using a simple expression to add an ellipsis "...", when the length of the text string was above some fixed number:
=Iif(Len(Fields!CustomerName.Value) > 25,
Left(Fields!CustomerName.Value,23) + "...",
Fields!CustomerName.Value)
But this does not work well when customer names contain a mixture of capital letters, lowercase letters, punctuation and other stuff that makes the individual character pixel widths vary wildly.
Ideally, some property for the textbox control would allow the report developer to add an ellipsis whenever text would not fit in a textbox.
Does anyone have any suggestions for a more elegant approach to this?
w = TextWidth(Left(str, l) + suffix)
inside yourFor
loop. – Mastectomy