Jump to content

Variable text color in table


Hawk

Recommended Posts

I am creating a table from an external data file. I need the text color of a row to be red if there is a Y in the last column of the external file. Can't seem to get it.

 

Here is what i have so far.

 

numRecsExtDF = XDFTop.recordCount;

var numRecsExtDF = XDFTop.recordCount;

var  myTable = '<table columns="6" Space="Above:180;Below:180" Alignment="Center" Margins="Top:60;Bottom:60;Left:60;Right:60"' 
myTable +='BoxRules="Top:thin,BLACK;Bottom:thin,BLACK;Left:thin,BLACK;Right:thin,BLACK" HeaderRules="Rule:thin,BLACK;" '
myTable +='ColumnRules="Freq:1;Default:thin,BLACK;Alternate:thin,BLACK" RowRules="Freq:1;Default:thin,BLACK;Alternate:thin,BLACK">'
myTable +='<column width=8000><column width=8000><column width=12000><column width=8000><column width=8000><column width=8000>'
myTable += '<row><cell margins="top:030;bottom:030"><p br=false quad=C>Provider Type<br />(renering service)'
        myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>Last Known<br />ICD-9 Code'
        myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>ICD-9<br />Description'
        myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>Date Last<br />Confirmed'
        myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>DHCC<br />Grouping'
        myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>Need to be<br />Confirmed in<br />2012 (Y/N)'
for (i=0; i <= numRecsExtDF; i++)
{      

   if (XDFTop.GetFieldValue(i, 0)==Field("hicn"))
   {   

       myTable += '<row>'
       myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ NormalizeEntities(XDFTop.GetFieldValue(i, 1))
       myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ NormalizeEntities(XDFTop.GetFieldValue(i, 2))
       myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ NormalizeEntities(XDFTop.GetFieldValue(i, 3))
       myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ NormalizeEntities(XDFTop.GetFieldValue(i, 4))
       myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ NormalizeEntities(XDFTop.GetFieldValue(i, 5))
       myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ NormalizeEntities(XDFTop.GetFieldValue(i, 6))

   }
}  
 myTable += '</table>';
 return  myTable;

 

I can't even change the color with a color tag.

 

I'm using VDP Creator 8. And Acrobat 9.

 

Thanks,

Larry

Edited by Hawk
Link to comment
Share on other sites

  • 2 months later...
Is there a way to do this with a color value rather than using a named color? We have a client that can use lots of many colors. Using the rule above, every time they want to add a new color, we'd have to open the template & recollect it. I'd like to give them a color picker & let them send color values if possible.
Link to comment
Share on other sites

Is there a way to do this with a color value rather than using a named color? We have a client that can use lots of many colors. Using the rule above, every time they want to add a new color, we'd have to open the template & recollect it. I'd like to give them a color picker & let them send color values if possible.

Yes, with FusionPro 8.1 or later, you can call “new FusionProColor” to create a color. The signature is:

new FusionProColor(name [,cyan] [,magenta] [,yellow] [,black] [,isSpot])

Where the CYMK values are percentages. You can find this in the Building Blocks dialog, on the Objects tab, under the “Resources” node.

 

An example is:

var myColor = new FusionProColor("Brown", 0, 3, 5, 62);
FindTextFrame("Title").fillColorName = "Brown";

Of course, the values can come from data fields, like so:

var myColor = new FusionProColor("User Color", Int(Field("Cyan"), Int(Field("Yellow"), Int(Field("Magenta"), Int(Field("Black"));
FindTextFrame("Title").fillColorName = "User Color";

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...