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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping question

Status
Not open for further replies.

pen81

Programmer
Oct 27, 2004
62
GB
I have a table that links to two other tables on the same field.

I have created a simple report that uses a group to list the matching records in the 2nd table for each record in the 1st table.

I also want the relevant records in the 3rd table to display in each list but have no idea how to achieve this?
 
Try Insert > Group and choose the field you are using to link the tables.

If you link table A to table B and table C, use a 'left outer' link from A to C if you still want to see details when there is no entry in table C for that account.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks

I am using Crystal 10

How would I get each group to print two lists, one from table B and one from table C, using the details section?

At the moment, I have a single details section and the records from table B are repeated as the records from table C are listed, which is not what I am wanting
 
Is there a fixed relation between Table B and Table C? Or could there be any number of either?

If it is any number of either, and you want two lists, I think you'd need to move Table C to a subreport in the group footer. Use Edit > Subreport Link to pass down the account number or whatever. This will eat up machine time, but I can't see another way to get what you want.

I'm assuming you don't want the lists of B and C side by side. If you do, this could be done, but only by using a subreport for both A and B, placed side by side in the Table A detail line. Even more inefficient, but machine time is constantly getting cheaper.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks

Subreporting is the answer and not too expensive on resources, as the subreport simply lists a dozen or so records for each group iteration.

I need to think more about the SQL query that Crystal generates to list the data, and no such query could be written to list table B rows followed by table C rows with no relationship between B and C and this is where subreports come in.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top