kbanks Posted January 18, 2013 Share Posted January 18, 2013 Hello, I think I already have the answer to this but thought I'd put it out here to be sure. Using FusionPro Desktop 6.2 I am trying to create a tagged text file that would allow me to highlight a variable field in my data with yellow. From what I have been able to read, and try, it appears that in this version the column width has to be set to a fixed number. Does anyone know if there is a way to create a var column width using this version of FusionPro? If so, would you please share the tag syntax in combination of applying a background color? Thanks, Keith Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 18, 2013 Share Posted January 18, 2013 When you mention column width, I assume you're talking about creating a table cell with a background color, which is often used to create a highlight effect on the cell contents. You can use the FusionoProTextMeasure object to calculate the width of the text, and set the width of the table cell (the column) accordingly. Quote Link to comment Share on other sites More sharing options...
kbanks Posted January 25, 2013 Author Share Posted January 25, 2013 Hi Dan, Below is how i have my syntax, can you tell me what I'm doing wrong. <table columns = 1 alignment = “left” Margins="Top:5;Bottom:5;Left:5;Right:5" CellShading = "Yellow"> <column width = FusionProTextMeasure.CalculateTextExtent> <row><cellshading="Yellow"><cell><(variable name="Company")> </table> Thnx, Keith Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 25, 2013 Share Posted January 25, 2013 Below is how i have my syntax, can you tell me what I'm doing wrong. <table columns = 1 alignment = “left” Margins="Top:5;Bottom:5;Left:5;Right:5" CellShading = "Yellow"> <column width = FusionProTextMeasure.CalculateTextExtent> <row><cellshading="Yellow"><cell><(variable name="Company")> </table> You can't just put "FusionProTextMeasure.CalculateTextExtent" in the table markup tags. You have to actually call the function in a JavaScript rule. Take a look at the code in this thread, which is doing basically the same thing: http://forums.pti.com/showthread.php?t=2578 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted January 25, 2013 Share Posted January 25, 2013 Here's my version of the rule: var Text = TaggedDataField("Name") // Replace with your field var PointSize = 10; // set the type size var Font = "Helvetica"; // set your typeface var Color = "Yellow"; // set highlight color var tm = new FusionProTextMeasure; tm.pointSize = PointSize * 100; tm.font = Font; tm.CalculateTextExtent(Text); var myTable = new FPTable; myTable.AddColumns(tm.textWidth + 100); var theCell = myTable.AddRow().Cells[0]; theCell.PointSize = PointSize; theCell.Font = Font; theCell.ShadeColor = Color; theCell.ShadePct = 100; theCell.Content = Text; theCell.Margins = { Top: 0, Bottom: 0, Left: 0, Right: 0 }; return myTable.MakeTags(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.