Progress Bars

From Fmfaq

Jump to: navigation, search

Go back to Techniques

Creating Progress Bars in FileMaker

There are a number of ways to generate progress bars in FileMaker. They range from very simple to quite complex. Some with a high degree of aesthetic appeal.

The most basic progress bar uses a series of pipe characters. The "pipe" character is the vertical line which is above the Return key (sometimes labeled Enter) - accessed using the shift key - on foreign keyboards it may be in another location. To calculate the progress of a loop through a series of records you only need to perform some simple math. Something like the following.

Let(
[
bar = "||||||||||||||||||||||||||||||||||||||||||||||||||";
pos = Get ( RecordNumber ) / Count ;
disp = Left ( bar; Length ( bar ) * pos)
];

disp

)

Where the field Count is a global field containing the total number of records to account for - which could be a subset of the found set or could be replaced with Get ( FoundCount ). When using the pipe character with a nice, fat, font you can really achieve a nice result. Make sure and set the display field to be bold and you might also use the Extend option under Format > Style (in Layout mode).

If you need to go all the way with custom graphics and multi-colored progress bars, then you need to work with container fields and storing each progressive variation of the bar - typically increasing by a width of one pixel at a time. The math will be similar to the calculation above, but will typically use the repetitions of a repeating container field, although related records can be used as well.
Contributed by Matt

Personal tools