Print Page | Close Window

Crystal Report & two tables

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5747
Printed Date: 08 May 2024 at 12:28pm


Topic: Crystal Report & two tables
Posted By: PaulMinsk
Subject: Crystal Report & two tables
Date Posted: 11 Mar 2009 at 7:47am
There are two tables in my dataSet. Can I display the tables (header 1<-> table 1 &  header 2<-> table 2) in Crystal Report (two tables - one report)?
Thanks (Crystal Reports VS 2008).



Replies:
Posted By: jkwrpc
Date Posted: 11 Mar 2009 at 12:37pm

You will need to create some empty formulas in the report  header sections and then you should be able to use code pass in the field values from the dataset tables. These formulas become part of a collection and you can reference the collection by name (a string) or the index number (an integer). For simplicities sake I always use the name.

Without looking, I believe this is done using the datadefinitions properties, though the .Net help file will give you the correct syntax for the object model.
 
Perhaps others can help with the explanation or correct any errors I may have made.
 
Apart from that, I hope this gets you pointed to the solution you need.
 
Regards,
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: jbleep
Date Posted: 11 Mar 2009 at 12:51pm
You can insert a subreport anywhere you want.  So do one report as you normally would, and then in the report footer of that one, after the last group, on the menu insert subreport.  You can create one, and it can be related to the first one or not.  It can be anything you want, and can use any tables you can access.

-------------
JB Leep


Posted By: jkwrpc
Date Posted: 11 Mar 2009 at 1:20pm
Sorry my mind was seeing a different question than the one you asked. I was trying to make it harder than it needed to be. You should be able to  create the dataset and put the datafields wherever you want them. I do have some recollection that  CR likes the datasets to be strongly typed. The subreport solution is one way but depending on what you want to do may be not be needed.
 
My apologies for what was a poor suggestion.
 
Regards,
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: PaulMinsk
Date Posted: 13 Mar 2009 at 1:39am
Thanks for your help.



Print Page | Close Window