StiPanel CanGrow Does Not Grow With Internal StiText Elements

Stimulsoft Reports.NET discussion
Post Reply
billy.goforth
Posts: 24
Joined: Fri Apr 09, 2021 1:44 pm

StiPanel CanGrow Does Not Grow With Internal StiText Elements

Post by billy.goforth »

I have the below code (C#) and am rending out a word wrapped StiText element INSIDE a StiPanel (Mine is inherited in custom class). Both have CanGrow set to true, yet the Panel will not grow and show all of the text when it is taller than the Panel.

What Am I Missing?

IMAGE ATTACHED TO SHOW DISPLAY FAIL. THERE ARE ACTUALL SIX ITEMS IN ARRAY
CAN_GROW_FAIL.jpg
CAN_GROW_FAIL.jpg (12.41 KiB) Viewed 1363 times


*** CODE ***
if(param != null)
{
var searchPanel = new StiPanel();
searchPanel.CanShrink = true;
searchPanel.Top = headerText.Bottom;


var tile = new ContentDisplayTile(); //-- CUSTOM PANEL
tile.CanGrow = true; //-- SET CAN GROW
tile.CanShrink = true;
tile.Name = "Tile " + count.ToString();
//tile.Width = .5;
tile.Height = .6;


var keyText = new StiText(new RectangleD(.05, .01, .9, .15));
keyText.CanGrow = true; //-- CAN GROW HERE
keyText.CanShrink = true;
keyText.TextBrush = new StiSolidBrush(Color.Gray);
keyText.Name = param.Key;
keyText.Text.Value = param.Key + ":";
keyText.ShrinkFontToFit = true;
keyText.Font = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular);
keyText.GrowToHeight = true;

var valueText = new StiText(new RectangleD(.05, .16, .9, .15));
keyText.CanGrow = true; //-- CAN GROW HERE
keyText.CanShrink = true;
valueText.TextBrush = new StiSolidBrush(Color.Gray);
valueText.Name = param.Value.ToString();
valueText.Text.Value = param.Value.ToString();
valueText.ComponentStyle = "Bold";
valueText.UseParentStyles = false;
valueText.WordWrap = true;
valueText.Font = new Font(FontFamily.GenericSansSerif, 5, FontStyle.Bold);
valueText.GrowToHeight = true;

tile.Width = valueText.Width + .1;
tile.Components.Add(keyText);
tile.Components.Add(valueText);


searchPanel.Components.Add(tile);

header.Components.Add(searchPanel);
}
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: StiPanel CanGrow Does Not Grow With Internal StiText Elements

Post by Lech Kulikowski »

Hello,

Please send us a sample that reproduces the issue for analysis.

Thank you.
billy.goforth
Posts: 24
Joined: Fri Apr 09, 2021 1:44 pm

Re: StiPanel CanGrow Does Not Grow With Internal StiText Elements

Post by billy.goforth »

The report is build 100% dynamically in c#. This is the exact code that is building the display tile with the overflow even with the CanGrow property set to true. You can see in the code where it is set, where the text is added etc. What else do you need? We do not have an actual .mrt for this report.
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: StiPanel CanGrow Does Not Grow With Internal StiText Elements

Post by Lech Kulikowski »

Hello,

We couldn't reproduce the issue on our sample.
Please send us a sample that reproduces the issue for analysis.

Thank you.
Post Reply