MeasureParagraphHeight does not work in ActiveReports v15.2.1

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

  • Posted 2 December 2021, 10: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.

  • Posted 3 January 2022, 5:30 am EST

    It seems like you have created a duplicate post. This has already been forwarded to the concerned team. We will inform you once we have an update on the same. To avoid confusion, any further communication related to this issue will be done on the original post here:-

    https://www.grapecity.com/forums/activereports/measureparagraphheight-doe_2

Need extra support?

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

Learn More

Forum Channels