You cannot change a field name via script but you can use merge variables and conditional formatting to rename your labels in the report.
Create text object and attach conditional formatting, similar to:
Let ( [
$custom01 = Case ( Type = "Sale" ; "T-Shirt Size" ; ...... ) whatever else you wish to test and label) ;
$custom02 = etc
Get ( WindowMode ) < 4 )
) //end let
... set the font to custom size 500 so the text object disappears unless in layout mode.
Then place <<$custom01>> ... <<$custom02>> etc as your labels. They will change depending upon the criteria you specify and chanage for each report and each label.
You're a rockstar! Thanks for the info. I will give this a try. Tahnks a lot.
LaRetta's solution will work on the report screen in FileMaker, but it isn't possible to export to Excel as you mentioned using this method. The variables only exist on the screen.
For a method to export to Excel, take a look at Kevin Frank's excellent "hack"on user friendly excel exports - this might serve your purpose.
Another method might be to create a "dummy record" as the first record with field names you want to display in Excel. Then sort the found set so that the dummy record with the field names is at the top. While this does not change the column names in Excel, it does give you the appropriate field name as the first row, which might be sufficient.
Hope that helps.
Thanks, Karen, I missed the export requirement.
I have missed a bunch of those, on this list, myself! Still a good answer except for the export. And that is part of a right answer - if you build an array using Robertson's virtual list, you could rename the fields and export the results that way. I didn't mention that one...
You're awesome. This is exactly what I was aiming for. LaRetta thanks too for your suggestion. I will be using your post for another purpose as well! I appreciate both of your help.
Yes, when I use virtual, I start the serial at 0 and use the first record can hold the labels. I haven't used it quite some time! Thanks for the reminder.