How to auto reduce font size if it is too long over fixed textbox in rdlc report

Fame th picture Fame th · Sep 14, 2015 · Viewed 8.8k times · Source

My textbox have a some properties like these

   txtBox.Cangrow = False

   txtBox.CanShrink = False

   Uncheck allow height to increase and decrease.

This textbox use for display value which receive from dataset. Sometime data is too long. So I need to know How to automatically decrease font size for matching with width of textbox?

Answer

Jonnus picture Jonnus · Sep 14, 2015

You'll need to manually determine which font sizes are required for stings of a certain length. You can then put an expression in the Font -> FontSize property as follows

=iif(len(Fields!myString.Value) > 20, "8pt", "10pt")

It's not possible to dynamically shrink the text to fit the textbox.