Expand my Community achievements bar.

Dynamic table highlight row if formula is true

Avatar

Level 2

Hi,

I have a dynamic table where end users will add rows as needed and some of the fields will automatically calculate based on the numbers.  What I need is if one of the calculations is below a stated value, I need the row highlighted automatically in yellow.  In the example below, say I want the values less than $10.00 highlighted.

Example:

CostSq FtCost/per Square
50105
3001030

Can anyone help me with this please?

4 Replies

Avatar

Level 7

On the calculate event for the field in question using FormCalc (placed after your current calculation script), try:

    if($<10)then
        $.fillColor = "255,255,0"   //yellow
    else
        $.fillColor = "255,255.255"  //white
    endif

You can change the font color also:

    if($<10)then
         $.fillColor = "255,255,0"  //yellow

        $fontColor = "255, 0,0"   //red
     else
         $.fillColor = "255,255.255"  //white

        $.fontColor = "0,0,0"          //black
     endif

Good luck,

Stephen

Avatar

Level 2

I think I am still doing something wrong.  I entered in the formula, Form Calc, Calcluation script and changed $ to the names of the Cost field and the field I want highlighted.  I get back the numbers 255,255,0.  I dont see where to attach my sample (wasnt that an option before?)  Here is my script, hiearchy, and a screen shot:

if

(Cost<100)then

PolicyNo.fillColor

= "255,255,0" //yellow

else

PolicyNo.fillColor

= "255,255.255" //white

endif

and my hiearchy is:

Table 1

     Header Row

     Policy

          AddRow

          DelRow

          PolicyNo

          Renewal

          AdjDate

          SqFt

          AOI

          Cost

cost per square screenshot.jpg

Avatar

Level 7

My example had an error doh!

the

= "255,255.255" //white

S/H/B

= "255,255,255" //white (replace the . with a , )

Also, personally, I would place the script on the Cost field (not the PolicyNo)--after your cost calculation.

Good luck,

Stephen

Avatar

Level 2

Stephen,

Thank you so far for your help.  I really do appreciate it.

It is still not working.  When I set up the formula in the caluclate field, it will not calculate my AOI/SqFt.  You are right.  I cannot place it in the PolicyNo field or else the field becomes read only and that is a data entered field.  The closest I come to getting anything is getting the numbers "255,255,0" to print as if LiveCycle think it is text.  I am saving this as a dynamic, Acrobat 8.  Would that make a difference?  I did get the field to highlight once, but I lost that code and the code was not reading the if then statement, just the last portion of the statement so no matter what was entered, it highlighted it yellow.