Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8056 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

confused.gif

I have a main database that contains business address information of on it. There is also a portal that displays names associated with the business. I want to print a form letter to each of the names in the portal with the appropriate business address on each letter. Right now I can only print one letter of the first name of each business, no matter how many names are associated with it. I know I can print the letters from the names database but then I would have to select each business at a time and print the letters. What I really want to do is print letters to all the names of all the businesses residing in a certain zip code, say, or all the franchises of a fast food chain on the database. How can I do this?

Posted

You should be printing from the related file, not the parent file. You can create a reverse relationship from the child file back to the parent file in order to retrieve the business name and address fields.

Posted

Wow, that's not very elegant at all. Having to select the records in one file and go to another file to print the stuff you want is pretty lame. I don't want my users to have to do all that. Any other suggestions? How about a script?

Thanks.

The MadJammer

Posted

Yes, you should have a script to do this. A script in the main file calls a script in the related file to do the printing. The user need not ever see the related file. So it's not really all that lame. Most of the information you are printing is in the related file, and you can place summary parts wherever you need them to show totals etc.

Posted

So from all this I gather that I could construct a dropdown box or an array of buttons or some some other device on the main file that would contain all the layouts that are available from the related file and then run a script for whichever report was selected. Could I have just one script, we'll call it PrintReport, and send it the selected report name as a variable or argument? This would eliminate the need for multiple scripts that are all the same except for the report name they are executing.

Also, can I populate the dropdown box or an array of buttons so that the available reports from the related file are listed? How can one tell the difference between a report layout or a regular layout when populating a dropdown?

Thanks

Jeff(The Mad Jammer)

P.S. Bob, don't eat brains. You might get Mad Cow disease.

Posted

Yes you can do it with one script.

First, the best way to transfer data between different files is to set up what is called a constant relationship. Create a calculated field in each file called Constant with the formula:

1

So, its value in every record will be 1.

Then create relationships between all files that need to pass data, based on this Constant field. Once you have done this you can access/change the contents of any global field from any file in which you have set up this relationship.

So, in your main file you can have a global called gSelectedReport that contains the name of the report that the user has selected. Then the related can access it with the syntax: ConstantRel::gSelectedReport.

You can get a list of all layouts from the related file into the main file with the design function LayoutNames(). A quick way to turn this into a popup menu is to make a stored calculated field cReportNames in the main file with this formula:

LayoutNames("RelatedFileName")

Then define a value list using values from the field cReportNames.

There are a number of ways of doing this. This one may not be the most efficient, but it's the easiest to explain and to set up.

This topic is 8056 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.