Solved

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

Posted on 2006-11-30
7
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FM - Formatting Merge Fields 4 637
Update a field for all records in a table 2 133
Filemaker xsl help please 3 106
Change Filemaker Server 14 https port 3 151
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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