dyoung520 Posted July 14, 2010 Share Posted July 14, 2010 I have one text box that contains multiple tables created outside FP. The tables are transactions and can vary in the number of rows. I'm attempting to use FusionProTextMeasure to determine the amount of vertical space required by each table, sum them, and then determine if an overflow page will be used. The following code was my test... var tm = new FusionProTextMeasure; tm.CalculateTextExtent(Field("PaymentsTable")); var astring = 'Messages:' + tm.messages + ' Width:' + tm.textWidth + ' Height:' + tm.textHeight; return astring; I get a value for width. However no value is returned for the height. I think my question should be can TextMeasure be used on FP-XML fields that represent tables? Thanks! Dan Link to comment Share on other sites More sharing options...
dyoung520 Posted July 14, 2010 Author Share Posted July 14, 2010 Can textLines be related to the height of a text frame? I'm just trying things... var tm = new FusionProTextMeasure; var frame = FindTextFrame("DetailTables"); tm.maxWidth = frame.width; tm.CalculateTextExtent(Field("ContractTable")); var total = tm.textLines; tm.CalculateTextExtent(Field("TransactionsHeader")); total = total + tm.textLines; tm.CalculateTextExtent(Field("PaymentsTable")); total = total + tm.textLines; tm.CalculateTextExtent(Field("PurchasesTable")); total = total + tm.textLines; tm.CalculateTextExtent(Field("FeesTable")); total = total + tm.textLines; tm.CalculateTextExtent(Field("InterestChargeTable")); total = total + tm.textLines; tm.CalculateTextExtent(Field("YTDTable")); total = total + tm.textLines; tm.CalculateTextExtent(Field("InterestTable")); total = total + tm.textLines; var astring = 'Lines:' + total + ' FrameH:' + frame.height; return astring; Results: Lines:2198 FrameH:39572 Link to comment Share on other sites More sharing options...
dyoung520 Posted July 14, 2010 Author Share Posted July 14, 2010 through trial and error I managed to figure out that the text frame could handle up to 2948 lines before requiring an overpage. wish I understood this a little better. Link to comment Share on other sites More sharing options...
Dan Korn Posted July 15, 2010 Share Posted July 15, 2010 I think my question should be can TextMeasure be used on FP-XML fields that represent tables? Unfortunately, the answer is No. Text Measurement only works with "regular" flows of text, not with things like tables and inline graphics. Link to comment Share on other sites More sharing options...
dyoung520 Posted July 15, 2010 Author Share Posted July 15, 2010 Thank You. Can you explain textLines? Through trial and error I believe I'm correctly determining when an overflow page is being used. The value returned does appear to increase in size in conjunction with the table size. -Dan Young Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.