Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying in report, fields from different data tables

Status
Not open for further replies.

mondi

Programmer
Sep 10, 2003
169
AL
In the Data Set, that I use for my report, I have different data tables. In the first table, I have an ID. This ID is the primary key for a second table. In my report, I have to display a data field from the second table that corresponds to that ID.
Thanks in advance for any help.
 
Mondi

As long as you have the 2 tables linked by the ID there should be no reason why you should not be able to display the data field from the second table.

Lewis
United Kingdom
 
Yes but in which way?
The firs table is named <ADDRESSES> and the second <COUNTRIES>. In the first I have a field <COUNTRY_ID> which makes the link with <COUNTRIES>. To display the field COUNTRY_NAME from the second table, should I write just {COUNTRIES.COUNTRY_NAME} in the formula editor because the link is done? If not could you tell me how to do it?
 
mondi

As long as the tables are linked on <ADDRESSES.COUNTRY_ID> equal to <COUNTRIES.COUNTRIES> there would be no reason why you should not be able to just select the field {COUNTRIES.COUNTRY_NAME} into your formula. Alternativley just drop it onto the report from the Field Explorer.

Lewis
United Kingdom
 
I think you have misunderstood me.
In a form the user has to enter the <COUNTRY_ID> which is found in the <ADDRESSES> table. Now in the report, I have to display the <COUNTRY_NAME> for that COUNTRY_ID. The COUNTRY_ID is the key. It is found in both the tables.
I need to know the exact code that I have to write to display in my report the name of the country to which it corresponds the ID chosen by the user.

Thanks
 
You dont have to write any code, per se. Link the two tables by {COUNTRY_ID}. Then click on insert, field object, database field and drag the {COUNTRY_NAME} field onto the report where you want it to appear.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top