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

Subreport Linking

Status
Not open for further replies.

tweetyng

MIS
Feb 23, 2006
46
US
I have a main report and a Sub-reportA on it, it's working and showing data fine on the main. However, I have another Sub-reportB link to an ID in Sub-reportA. When I run the Sub-reportA by itself, it's working fine and showing all data I need, but when I run the main report, the Sub-reportB seem like it's not working and show nothing on it. Can someone please help, thanks alots

TN (USA). I'm using Windows XP, Crystal Reports 10 and SQL Server
 
You can only nest subreports one deep, not subreports within subreports.

In general, try to avoid subreports by creating better data sources, such as Views or SPs.

-k
 
If I can't use subreport within subreport, so does anyone know any other way to do to link to an ID in the subreport. Because the main report doesn't have that ID to link with, only the subreport does. thanks

TN (USA). I'm using Windows XP, Crystal Reports 10 and SQL Server
 
The first thought is that you might want to make your subreport the main report, or you can pass values back and forth using shared variables.

There's nothing technical in your post, so it's difficult to assist you.

Try posting:

Example data (what's in the tables)
Expected output (what you need from the report)

Generally it's best to avoid subreports.

-k
 
Here is my sample

On the main report got data from this table

CustomerID CustomerName Date
1 Sebile, Jalo 1/5/2005
2 Jonhson, Mike 2/5/2005
3 Garcia, Rosa 10/20/2005

On my subreportA retrieve records from this table

CustomerID ContactID ContactName
1 200 Zamora, Maria
1 201 Hernandez, Roberto
2 202 Houston, Johnny
3 203 Wilkinson, Tracy
3 204 Urrutia, Amber
3 205 Martin, Tiffany

My subreportB got records from this table

ContactID TSTDate MM Result
200 1/1/2006 20 P
200 2/15/2006 0 N
200 3/30/2006 15 P
201 4/1/2006 0 N
204 4/3/2006 8 P
205 4/6/2006 10 P


Those are 3 table I need to retrieve records and show on my main report…
I only can link CustomerID in the main table to CustomerID in the SubreportA table, and link the ContactID from subreportB to ContactID in subreportA table, cause there are no ContactID in the main table, and I would like to show data like this on the main report (I use parameter to enter each CustomerID to run by each time), If I enter CustomerID = 1 in parameter my report should show like this:

CustomerID: 1
CustomerName: Sebile, Jalo
Date: 1/5/2005

ContactID: ContactName: TSTDate MM Result
200 Zamora, Maria 1/1/2006 20 P
200 Zamora, Maria 2/15/2006 0 N
200 Zamora, Maria 3/30/2006 15 P

2001 Hernandez, Roberto 4/1/2006 0 N

Please help if I can’t use subreport to link to another subreport, which one can I use, thanks


TN (USA). I'm using Windows XP, Crystal Reports 10 and SQL Server
 
I don't think you need subreports. Use the table from subreport A as your first table, and then link each of the other two tables to this. This should fine without subs.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top