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!

Sub-report within a sub-report - IS THIS POSSIBLE

Status
Not open for further replies.

eo

MIS
Apr 3, 2003
809
0
0
Due to very complex nature of one of our reports, i thought it easier to show some information as a sub-report of a report which is in turn also a sub-report of the complexed main report. Using the nromal route, this does not seem possible. Is this assumption correct. Any advise?

EO
 
It's correct that you cannot nest subreports. If you want to peruse the possibility of alternative options, specify what you're trying to do, with some examples, and we'll take it from there.

Naith
 
Hi
i'm not sure but maybe call this sub report on demand

cheers

pgtek
 
On Demand subreports can't contain a subreport.

You may be able to use what I call a "middle-out" approach whereby the main report is the second level and it uses a subreport to show the higher level and another subreport to show the lower-level.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
I think another option would be to have two sub-reports within the primary report, as opposed to a sub-report within a sub-report. But, as with everything, things are not that simple. I need to pass a field that exists in the first sub-report only to a parameter set for the second sub-report. Would it be possible to use a shared variable from the first sub-report, pass this to the primary report and from there pass it to the parameter of the second sub-report?

EO
 
Yes, you can do that.

Once you have declared a shared variable, you can pass it between subsequent subreports and the main report indefinitely.

You just have to ensure that you do not place the subreports within the same section in the main report.

Naith
 
Naith

Unfortunately the two subreports have to go into the same section. This route is therefore not an option to me. What I have done though is try and link the tables using CR 9 (our test version) as opposed to CR 8 (our actual application). And the ODBC error experienced before (which was the whole reason for trying sub-reports within sub-reports, and shared variables between two sub-reports in the same section) dissappeared. Probably a missing DLL (???). Thanks for all the effort anyway.

EO
 
EO,
although you seem to have seem to have fixed your immediate problem, I've been able to use shared array variables to do similar things to what it seems you are attempting to do...

It's not a pretty solution, and I wouldn't recommend it if you want a lot of data passed between sub-reports, but it is useful to display data from multiple subreports in the same section.

It's a bit difficult to describe without a specific example, but essentially the 1st subreport retrieves the parameter for the 2nd subreport. The 2nd subreport then retrieves the data and stores it in an shared variable array (depending on what you're trying to do, an array might not be necessary, it could just be a shared variable). This array is then passed to a 3rd subreport (which could be a copy of the 1st subreport) where the appropriate values are then extracted for display alongside the rest of the subreport's data...

Hopefully that's not too confusing, but I can go into more detail if people wish...

Jason Street


-----------
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top