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

Sub report Not showing 4

Status
Not open for further replies.

eatwork

Technical User
May 16, 2005
155
0
0
CA
Crystal Reports: .Net
Database: MSAccess
Report Datasource: XSD
Problem: I have a report that has a subreport. This subreport has its own subreports.
Eg. Report quote - group quoteId
subreport items - group quoteId
sub subreport notes - group quoteId, itemId

The sub subreport views fine when I open the subreport, item, by itself, but when I try to view the quote report, I can only view the subreport and that subreport does not show sub subreport items.
ANd ideas on how to fix this? thank you
 
Are all your subreports linked to the parent report?

I had this problem too, but when I double-checked the subreport links, then I was able to view my sub-reports.
 
Hi ReportingAnalyst,
My subreport is linked to the main report, and the sub subreport is linked to the subreport.
 
Hi everyone,
I would like to add that this question is based on a nested sub report eg main report -> sub report -> sub sub report.

I was doing some reading and came across an article stating that crystal reports is incapable of nested sub reports? is this true? Thank you.
 
Yes, you can't go below subreport. You can pass details back using a Shared Variable: do a SEARCH on Forum 1 for details. You can probably get the same effect by passing a value up from one subreport and down into another.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi Madawc,
Thanks for your info. I will see if I can pass details from one subreport into another. Does this method of passing values affect efficiency at all?
 
A subreport accesses the server each time you call it. They are best used just once in the report, report header or footer. When used for groups or detail line they slow down the report a great deal.

I don't think the specific act of passing data from the main report and back makes much difference.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi Madawc,
Thanks for the info, seeing as how I have never done this method of reporting, and am new to CR, would you happen to know of any online, step by step, tutorials on how to achieve what you are saying? This would be extremely helpful as many of my reports that I will be creating will be using many subreports within one main report in the details section and I would like to make these reports as efficient as possible. Thank you
 
I would suggest that you try to consolidate the data into a single recordset using an MS Access Query, and base the report on the query.

As Madawc stated, you can't nest subreports, and they're generally a bad idea anyway.

If the data seems unrelated, then you might add some commonality by using UNION ALL queries or some such, I do so fairly often.

To demonstrate subreport vairable passing, place this formula in your report header:

whileprintingrecords;
shared numbervar MyValue := 100

then in your first subreport place a formula of:

whileprintingrecords;
shared numbervar MyValue:=MyValue+200;

then in your next subreport place:

whileprintingrecords;
shared numbervar MyValue

You'll see that each subreport read the same variable, at the time the subreport executes.

But again, try to avoid this approach, return the data in one recordset if possible. MS Access is a much better database engine than Crystal, so let it do the work.

-k
 
In addition to what "synapsevampire" posted, try to replace each sub-report with Sub-query’s used in an Access Query.

For Example:

SELECT
[FIELD1],
(SELECT [FIELD3] FROM TABLE1 WHERE TABLE3.FIELD1=TABLE1.FIELD3)as SQuery,
[FIELD2],
[FIELD5]

FROM TABLE3

When you specify the "TABLE3.FIELD1=TABLE1.FIELD3" in the sub-query, you are in essence creating a "Linked Sub-report" Only this method offloads the processing the Database.
 
Hi synapsevampire and BOjdh2n,
thanks for your replys.

I will try the solutions you have posted, but creating one query to encapsulate all the information required for these reports could be tough as the # of records returned could be massive, 30,000+ records unfiltered. But thank you, learned something new today and will try to incorporate that into the project.
 
hi,
i was also encountering this problem; later i realise that the subreports are only one level deep.if u make it 2 level deep, the section remains blank. so try other optiions
 
hi,
i was also encountering this problem; later i realised that the subreports are only one level deep.if u make it 2 level deep, the section remains blank. so try other options
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top