Textbox height - can I make it fixed to keep a panel at a set height?

2 Answers 478 Views
Report Designer (standalone)
Brian Norris
Top achievements
Rank 1
Iron
Brian Norris asked on 23 Sep 2021, 06:28 PM

Hello...

I have a report where pixel-accurate placement is critical. I understand the basic CanGrow functionality, how text boxes will grow with more data, how they will cause a panel to expand accordingly, etc. What I'm facing is a situation where I need to display ONLY upper-case letters or numerals toward the bottom of the panel, so there will be no descenders. I have the textbox set to CanGrow = False and CanShrink = False. But when I use a larger font (set dynamically), one that will display the characters properly in the report, the textbox DOES grow, causes the parent panel to grow, and destroys the rest of the report placement. 

You'll see in the attached partial screenshot of a preview that the item on the left has a textbox that has grown and caused the panel (in orange) to grow. What I believe it should do is NOT grow, even if that means it cuts off any descenders. Various threads and docs have said that a textbox would not grow with CanGrow set to false, but in this case it most definitely does. 

So... Is there a way to set a panel to a fixed size in some other way. I have every object in that panel set to CanGrow = False, but it does not seem to matter.  Can I set the Height programmatically in some way that will override the CanGrow internal logic? I've tried setting it in the Bindings, but it seems to get overridden.

I'm using Reporting R2 2021.

Any help is much, much appreciated!!! Cheers...

2 Answers, 1 is accepted

Sort by
1
Accepted
Brian Norris
Top achievements
Rank 1
Iron
answered on 28 Sep 2021, 01:38 PM

Dimitar,

You are correct. The very large text is in it's own textbox and is growing to accommodate the first line of text. That is absolutely the issue here. Thank you for the link to that TextBox page, as it does contain a line describing that which I missed during my searches. I apologize for missing that. 

For those that come here looking for a solution... I found that I can set the bottom padding for the TextBox to a negative number to eliminate that extra whitespace created. It may take a little experimentation to get the right number, but I was able to get the bottom of the text characters nearly flush with the bottom of my TextBox and Panel without growing either vertically. This allows me to create a label with very large characters sitting right on the bottom of the label, which is critical in my case.

Another related tip... I found that when you have overlapping TextBoxes there can be some unpredictable movement, both horizontally and vertically. I found that making the TextBox edges go completely to the Panel edges, then using padding, can conquer at least some of that unpredictable movement. Also, the anchoring and docking functionality can help eliminate that movement, too. This was critical as I converted some Crystal Reports designed to print labels with many overlapping TextBoxes. The automated Crystal Reports Convertor does not do this, which makes total sense. So it does require manually adjusting many of those overlapping TexBoxes to do things the Telerik way. In the end, you can achieve the exact same thing, but you have to adjust the way you think about handling all of that TextBox alignment and overlapping.

0
Dimitar
Telerik team
answered on 28 Sep 2021, 10:01 AM

Hello Brian,

Thank you for the provided screenshot.

I would like to ask, is the textBox that grows only displaying the big numbers? Because the rest of the text in the image, like "SAVE MESSAGE FRN" for example, looks to be the same size in both cases.

If that is the case,  the problem may be that the TextBox would always grow to accommodate the first line of text even when CanGrow is False. For more information, please see the Growing and Shrinking section.

Please try to also set the TextWrap property to False. If TextWrap is False, the text will be cut in the middle of the word, hence all the text that fits in the TextBox will be shown and hopefully, it will not grow.

If you would need further assistance, you may send us a sample report, alongside some sample data, and we will inspect it locally.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
Report Designer (standalone)
Asked by
Brian Norris
Top achievements
Rank 1
Iron
Answers by
Brian Norris
Top achievements
Rank 1
Iron
Dimitar
Telerik team
Share this question
or