Renaming formulas in the Formula Editor vs the Field Explorer

Sunday 24 December 2017 @ 12:48 am

I write many formulas, and the more formulas there are in a report the more import it is to name them well. About 10 years ago I wrote an article with tips for naming formulas. I will often come back and rename formulas when I find that the original names aren’t clear enough. One of the main points of that old article was “don’t be afraid to rename formulas”.

But there is one thing I didn’t mention in that article. You get a slightly different behavior if you rename formulas while you are inside the formula editor as opposed to if you rename formulas in the Field Explorer. The difference has to do with the formulas being listed in alphabetical order. When you rename a formula in the Field Explorer that field gets repositioned immediately based on the new name. But, when you rename a field in the Formula Editor the field doesn’t get repositioned immediately. The formulas won’t be resorted until the next time you modify and save a formula’s contents.

Say I have 50 formulas in my report and I want to rename 12 of them from “Payables 01”, “Payables 02”, etc. to “AP01”, “AP02”, etc. If I am in the Field Explorer and rename “Payables 01” to “AP01” that formula (and my cursor) would be immediately moved to the “A” section of the formula list. To rename “Payables 02” I would have to pick up the mouse and scroll back to the “P” section of the list to find it. That formula would also move immediately to the top of the list, and so on. But, by renaming these fields in the Formula Editor I can rename the first formula, hit “Enter” and simply use the down arrow to move to the next field. All 12 fields stay together during the renaming process and they don’t get alphabetized right away. When I am ready to alphabetize the list again I select any formula and add a space to any line and then hit “Save”. The list gets alphabetized and the 12 renamed fields move to their new positions.

Note – you can’t just click save. You have to modify a formula and then save it. That is why I typically add a space and click save.

So next time you want to rename a group of formulas you can use this trick to save a bit of scrolling.

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







Leave a Reply

Jeff-Net
Recrystallize Pro

Crystal Reports Server