Crystal Report Formatting

  • Thread starter Thread starter Hemang Shah
  • Start date Start date
H

Hemang Shah

How can we display a lookup value from another table, when their
corresponding id is stored in the parent tables.

E.g:

Table1: tblCustomer

CustID

Name

Age

TypeID1

TypeID2

TypeID3



Table2: tblLookup

TypeID

TypeName





I cannot set relationship between these two tables as multiple feilds in
Customer table point to Lookup Table



Now in crystal report, when my source table is Customer, it ofcourse
displays all the typid, how can I lookup the "TypeName" in tblLookup on the
fly and display that.



Any Ideas ?

Thanks
 
Hi,

It looks like your database is not normalized if you have multiple columns
for the ID instead of one. In this case (see my reply on your previous
posting) I would suggest to implement data manipulation in a stored
procedure and return result from it
 
The database is normalized Val

The multiple column for ID is not ID as the primary key

but multiple foreign Keys..

Suppose you have each student speaking 3 languages.

the student table would be:

tblStudent
-----------
First Name
Last Name
Language1ID
Language2ID
Language3ID
....

tblLanguage
-------------
ID
LanguageName



This way your database is normalized, but you cannot have relationship
between the two tables.

But in my report, I do wanna print the languageName and not the ID.

Thanks

Hemang

Just that you can
 
Hi,

This is classic way when it is not normalized. To normalize it you should
create third additional table, that will be between tblStudent and
tblLanguage and would look like (assuming that StudentID as a PK from your
tblStudentTable), where ID is a value from the tblLanguage

tblStudentLanguage

StudentID
ID



--
Val Mazur
Microsoft MVP

http://xport.mvps.org
 
Thanks Val

That would be a many to many relationship correct?

But this table will not tell me which is the first language, second language
& third language

It will give me all the languages for each student but I wouldn't know which
language.

The way to work around that would be to create 3 tables for each language.

I already have my data entry forms and presentation layer finished.

Changing table structure now is definately not an option..

Is there a work around for this in Crystal Report ?
 
Back
Top