Calculate Height of a Text Box

Calculate Height of a Text Box

Forum member · Jul 18, 2007
I am creating a report where I loop through a database. At each iteration, i gererate a single row table and populate it with data. Immediately after this table I may or may not (depending on the data) insert a note. After the note I will continue with another table for the next record. My question is how do I calculate the height of text in the text box? I am using MyFormattedTextArea but suppose I could use something else. The note may be blank, one line, or many many lines. I have tried using the MyFormattedTextArea.y property but that seems to return the height of the text box regardless of how much text is in it. I want the value of height of just how much text is in it so I can start the next table at the appropriate spot. Thank you.

Re: Calculate Height of a Text Box

Support · Jul 18, 2007
Hello, You can find out the height required to add the given text using the GetRequiredHeight method of the TextArea page element. Once you get the value, you can reset the height of the TextArea equal to GetRequiredHeight(). You can calculate the required height for the text only using TextArea or FormattedTextArea page element. Thanks, ceTe Software Support Team

Re: Calculate Height of a Text Box

Forum member · Jul 18, 2007
Thank you, that did the trick. Now I am trying to calculate when I reach the bottom of the page so I can make sure the FormattedTextArea starts on a new page. It seems like when I use the GetRequiredHeight, I have to have already issued the AddFormattedTextArea. How can I acquire the GetRequiredHeight value *before* I place it on the page? Thanks again.