Solved

How to change field names in a report layout using a script

Posted on 2006-11-30
7
343 Views
Last Modified: 2010-04-27
Is it possible to specify the name of a field to be printed on a report layout using a script ?

I have a report that has to be printed 6 different ways. The 6 reports are almost identical, where the only difference resides in the name of 1 field that changes in each of these reports. So I would like to create only 1 layout instead of 6, and use a script (or whatever technique appropriate) that would get the proper field name to print, based on a selection made by the user.

Is this possible ?

Thanks.
0
Comment
Question by:ndidomenico
  • 4
  • 3
7 Comments
 
LVL 28

Expert Comment

by:lesouef
ID: 18048576
you can use a seventh field for the layout, calculated from the other 6 values + the report type:
7th field definition =
case (
report_type=1 ; data1 ;
report_type=2 ; data2 ;
report_type=3 ; data3 ;
report_type=4 ; data4 ;....
)

 or
use a normal 7th text field and have the print script to change its value accordingly.
0
 

Author Comment

by:ndidomenico
ID: 18049615
I think I understand your suggestion and got it to work. Thanks !
Below are the steps I used. Is this what you had in mind?:
1) Create a calculated, unstored field named Field7 which returns a Text value
2) Entered the "case..." statement in the field definition.
3) Created a global field called report_type which gets set by my script (1,2,3..)

Now, for your 2nd option, I'm not sure I understand properly. Is this 7th field a "regular" text field (not calculated, not global) and put in there one of the 6 field names ?. Could you give me more details ?

Thanks
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18050333
1
roughly, yes. the global field for the report type could have been a variable too.
2
yes, instead of using a calc. field, your script calculates the result and put it in a regular field. fairly equiv. to solution 1
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:ndidomenico
ID: 18050874
2:
In this scenario, the script must calculate the result for each and every record in the table before printing the report ?

I was hoping for a solution where the script could store in a global the name of the field that has to be printed on the layout, and use this global in the layout to get the appropriate field to print. Doesn't work that way, right ?



0
 
LVL 28

Accepted Solution

by:
lesouef earned 500 total points
ID: 18052041
2
I thought it was the same field for everybody; if this is false, then use the calc. field as it will be faster than a loop in a script
and
for your other thought, you still something to get the value from the selected field.
so assuming you store the field to be chosen in a global named "field2select", place a calc field in the layout, say "selectedFieldContent"=getfield(field2select) which will get the value of the field specified in field2select. but that means that it is the same field for all records if the field2select is global. If it has to be different, then field2select must be standard. but I still think a variable can do it... my pb is that I don't know how you decide on which field to select
0
 

Author Comment

by:ndidomenico
ID: 18053347
Thanks for the solution. Works great! I'm using the calc. field + global for the field name method.
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18053361
perfect then
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now