crystal reports, populating a column

1.1k views Asked by At

I have a crystal report which fetches data from a table. It is then displayed in a tablular format. Now I want to add a new column in the report. The values for the new column will be based on the values of an already existing column which is getting populated from the table. The relation is based between the tables.

For eg: Currently crystal report fetches data from XYZ table. The values of columns column1 and column2 are displayed in the report. Now I am adding a new field in crystal report to be displayed. The values for this field is obtained from a column of another table, say column3 of table ABC. Table ABC has column3 and column4. The relation will be like, i have to select ABC.column3 where XYZ.column2=ABC.column4.

How to achieve this in crystal report.

Thanks in advance

1

There are 1 answers

0
Bala R On

In the report creation wizard, select both your XYZ and ABC tables, similar to this

enter image description here

Then in the next step, setup the relation [XYZ.column2=ABC.column4], similar to this

enter image description here

Now in the next step, select all the columns you want to display from both tables, similar to this

enter image description here

That should take care of your requirement.