Applying the same format to many fields

Tuesday 18 February 2014 @ 6:00 am

A user recently asked about setting the format of a large number of fields. He wanted to have all the negative numbers show in red and positive numbers show in black. The formula wasn’t a problem, but he was looking for a way to avoid writing a unique formula for each field.

I suggested that he use this as the font formula for one of the fields:

if CurrentFieldValue < 0
then CRRed
else CrBlack

Then all he would have to do is use the format painter (paintbrush icon) to paint this format to all the other formulas that need to be changed. Since the formulas refer to the CurrentFieldValue the formula is exactly the same for every field, including formulas and subtotals. And to speed it up even more you can double click on the paintbrush to make it ‘sticky’. Then you can single click every field that needs that same format.

(For examples of my most popular formulas, please visit the FORMULAS page on my website.)

One Response to 'Applying the same format to many fields'

  1. Stumac - April 1st, 2014 at 10:50 am

    I had forgotten about the CurrentFieldValue, but even better I didn’t know that double clicking the format painter made it sticky… Great tip :)

Leave a Reply

Recrystallize Pro

Crystal Reports Server