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

Subreports within subreports? is this possible?

Status
Not open for further replies.

WhiteKnight2K

Technical User
Dec 30, 2002
26
0
0
CA
Hello,

This is the problem that I am encountering, but first a little background to set the context.

A property can have many contacts. Each contact can have many email addresses and /or phone numbers and/or mailing addresses.

I have a main report and within this report there are subreports. THere is a subreport for property, contact, email, phone number and mailing address.

for each property, i want to be able to show the following in this exact order:

Property #1

Contact #1

Email address #1
Email address #2
Email address #3
...

Phone No 1
Phone No 2
...

Mailing address #1
Mailing address #2
Mailing address #3

Contact #2

Email address #1
Email address #2
Email address #3
...

Phone No 1
Phone No 2
...

Mailing address #1
Mailing address #2
Mailing address #3

and so forth...

Right now i can get it to show as follows (which is not what I want):

Contact #1

Email Address #1
Phone No 1
Mailing address #1

Email address #2
Phone No 2
Mailing address #2
...

Contact #2

Email Address #1
Phone No 1
Mailing address #1

Email address #2
Phone No 2
Mailing address #2
...



Now, I have figured out a way to get what I want with subreports and this is how the design is:

subContact.rpt

Group By: Contact

Details A: Contact info

Details B: Email (subreport)

Details C: Phone No (subreport)

Details D: Mailing Address (subreport)

and it outputs the following, which is exactly what i want:

Contact #1
Email address #1
Email address #2
Email address #3
...

Phone No 1
Phone No 2
...

Mailing address #1
Mailing address #2
Mailing address #3

Contact #2

Email address #1
Email address #2
Email address #3
...

Phone No 1
Phone No 2
...

Mailing address #1
Mailing address #2
Mailing address #3
...

However, the problem is that when i insert this subreport called subContact.rpt into my main report (the one with the Property, etc) the subreports within subContact.rpt (i.e. subEmail, subPhone, SubMailingAddress) are gone and I am just left with the Group By Contact and the Contact Info from Details A, the other subreports are gone.

I'm wondering why the subreports are gone, is it that you cannot have subreports within a subreport? And if that is the case, I dont know how I can design this the report the way I want.

Any and all help will be greatly appreciated...if this is confusing, I can try and clarify it for you.,

Thank you,

Christopher

 
You can't have a subreport in a subreport. Formulas within formulas works fine, but sub-subreports are not part of Crystal.

In my report designs, I sometimes get round this by having the 'main' report doing very little and having several subreports that do distinct tasks at different levels.

Or maybe you could group contacts by property at the main-report level? Madawc Williams
East Anglia
Great Britain
 
hmmm....well i cant group contacts by property from the main report because there are many subreports in the details section. And my subreports do perform distinct tasks so any way I can accomplish what i need to?
 
You may be pushing Crystal beyond its limits. Another approach would be to do much of the data crunching through a stored procedure and pass the dataset to Crystal. Or you can have the stored procedure create a non-nomalized table with one record per logical observation and then use Crystal on it. This is the data warehousing approach. Howard Hammerman,
Crystal Training and Crystal Material
On-site and public classes
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
As Howard Hammerman says, you may need to use a Stored Procedure. These cannot be mixed with ordinary data (at least not in Crystal 8.50). But you can access other data using subreports.

Note also, a subreport can be placed anywhere, including a Group Footer section. Does this help? Madawc Williams
East Anglia
Great Britain
 
hmmm....how would i get the result I want using a stored procedure....if only CR allowed for nested subreports =o(
 
You might try reorganizing your report as follows:

Property #N

Details A: Contact info (SubReport Linked using Property ID to limited contact info only for Property #N)

Details B: Email (SubReport Linked using Property ID to limited EMail info only for Property #N)

Details C: Phone No (SubReport Linked using Property ID to limited Phone info only for Property #N)

Details D: Mailing Address (SubReport Linked using Property ID to limited Mailing Address only for Property #N)

This might work but if you have alot of data then processing it on the database server is the way to go.
 
Thanks for all the replies but none of the suggestions thus far have worked....except the Store Procedure way might work, although I dont know how to use one or even how to CREATE a stored procedure...is this the same as a Query in MS Access?

All I would like to do is group my email addresses, phone numbers, and mailing address together, as opposed to having them alternating. And I can't do this with a subreport at present because there is more than just this info that the report must report on...this is just the Contact info portion of the report. I also have to report on the Property, Surveyed trees, Inquiries, etc.
 
if i create a store procedure, will that stored procedure return an entire record set or can i return just a portion of the recordset (i.e. the email address) and if i throw the stored procedure into the details section of my subreport, will the entire record set be displayed before going to the next details section within the subreport?
 
Hi!
You can use views instead of some subeports
 
Hi
Yes, you can have a sub report in sub report. But, when you add it to main report you will loose the second sub report.

ndp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top