Jump to content

Highlighted Variable text


kbanks

Recommended Posts

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

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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();

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...