MeasureParagraphHeight does not work in ActiveReports v15.2.1

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

  • Posted 2 December 2021, 10:12 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 2 December 2021, 10:34 am EST

    The issue is actual for v15.2.4 too.

  • Posted 9 December 2021, 7:20 am EST

    Hello,

    Have you taken a look of this problem?

  • Posted 9 December 2021, 7:35 am EST

    I`ve created one more code snippet taken from the one above but with certain input data and it gives the same result:

    
    .....
    var newPage = new Page();
    				sizeText = newPage.MeasureParagraphHeight("stay comm", 0.462000072f, new Font(new FontFamily("Arial"), 10), StringFormat.GenericTypographic);
    ....
    
    
  • Posted 23 December 2021, 7:40 am EST

    Hello ,

    Thank you for the sample of code. i have forwarded this issue to the developers team.

    (AR-28103)

    Thanks,

    Sergey Romanov.

Need extra support?

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

Learn More

Forum Channels