FileMaker gradient progress bar with one field - without containers | FileMaker | Scoop.it

I needed a progress bar, which looks great to show a script progress on a found set.

I didn't want to use containers and started thinking about how I would be able to create the progress bar without them.

Here's what I came up with:

The progress bar is a simple repeating field calculation(text) with 100 repetitions.

It uses the following calculation:

Let ( [r1=123;g1=80;b1=200;r2=10;g2=180;b2=50] ;

If ( Truncate ( (Get(RecordNumber)/Get(FoundCount)) * 100 ; 0) ≥ Get ( CalculationRepetitionNumber );

TextColor ( "█" ;RGB(

r1 + Floor((Get ( CalculationRepetitionNumber ) * (r2 - r1) / 100));

g1 + Floor((Get ( CalculationRepetitionNumber ) * (g2 - g1) / 100));

b1 + Floor((Get ( CalculationRepetitionNumber ) * (b2 - b1) / 100))

)

);""))

The first part of it is a LET calculation where I set up the beginning and the ending RGB colors, which will be used to calculate the actual repetition font color. The second part is a percentage calculator based on the current record and the found set.

The last part is used to calculate the actual RGB color.

The layout is simple, I just added the 100 repetitions, resized it, and set the font size to 72 points. I also added a fill color to the containers, that is what you can see under the gradient bar.


Via David Anders