MeasureParagraphHeight does not work in ActiveReports v15.2.1

Posted by: dpet on 2 December 2021, 1:10 am EST

  • Posted 2 December 2021, 1:10 am EST

    Hello,

    We have a code which had been working for a long time before we upgraded to v15.2.1 from v10 and the MeasureParagraphHeight(string strText, float width, Font textFont,StringFormat strFormat) method started returning SizeF with values (Height = 0, Width = 0) for some reason. The simplified code snippet:

    
    		private static RectangleF ResizeRectangle(Page curPage, TextBox textBox, string text, RectangleF rect)
            {
    	        var page = (Page)curPage.Clone();
                SizeF sizeText;
    			if (textBox.CanGrow)
    			{
    				sizeText = page.MeasureParagraphHeight(text, rect.Width, textBox.Font, StringFormat.GenericTypographic);
    				if (sizeText.Height > rect.Height)
    				{
    					rect.Height = sizeText.Height;
    				}
    			}
                return rect;
            }
    
    

    P.S. This code is executed while Format event.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels