Jump to content

FusionProTextMeasure and Tables


dyoung520

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...