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

mulitple level subreports

Status
Not open for further replies.
Dec 5, 2001
18
US
Is there any procedure (trick) to have multiple Level (2 levels) subreports? thanx for the assistance.
 
You can't have 2-level subreports, but
there is a potential trick (I call it
a "middle-out" approach):

In many cases you can make the subreport at
level 1 the main report. Then make the original
main report as well as the subreport at level 2
subreports to the main report.

Cheers,
- Ido ixm7@psu.edu
 
Could you explain this further I am not quite sure what you are saying!!
 
OK, here's a little bit more detail about
the proposed solution:

Imagine you have a report showing for each
customer all their orders and all the line items.

You can't create it as a Main report for Customer and within that subreport for Orders, and within that subreport another subreport for line items. This is because a subreport cannot conain another subreport.

As a side note, we can obviously use grouping levels and avoid the need for subreports in this case. This is just for demonstration purposes. However, in many cases what seems like a need for a subreport can be removed by better SQL and grouping.

Now assuming we must separate Customers/Orders/Line Items into a main report and subreports, we can still achieve this using what I call a "middle-out" approach:

1. Make the middle layer (Orders) the main report.
2. Make the top layer (Customer) a subreport inserted in the group header of each Order. This subreport will return only one Customer for each order. If needed, you can suppress it (using a shared variable) if the previous order had the same customer.
3. Make the low layer (Line Items) a subreport
in the group footer of the Orders. This subreport would show all line items for a given order.

I hope this clarifies things.

Cheers,
- Ido ixm7@psu.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top