?
Solved

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

Posted on 2006-11-30
7
Medium Priority
?
349 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 2000 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

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…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

762 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