views:

131

answers:

1

I have a main report which contains user information -- and a subreport that contains multiple items for said user.

Question is, I need the main report to duplicate as many times as necessary for the number of users I feed into the DataSource -- how can I do this, so that it results in one large report (containing multiples of the main report)?

EDIT: Let me re-ask with a specific example (similar to my own): Let's say I want a report for a grocery shopper -- all of the shopper's demographics would be on the main report, however, there needs to be a section (or subreport) for a specific shopping trip containing all items purchased.

NOW, here is the clencher. I need to run this report for many different shopping trips (this also means different shoppers too).

It might even be better to say that this is a "shopping trip" report, which can run for a batch of shopping trips.

FURTHER PROGRESS: How can I get the grouping to work when my data looks like this:

(shoppingTripId, shopperId, shopperName, shoppingDate, itemBought)
------------------------------------------------------------------
1, 1, Chris, July-24-2009, Computer
1, 1, Chris, July-25-2009, Laptop
2, 3,  John, June-14-2009, Ipod
2, 3,  John, June-14-2009, Television

The report, if all goes well, would look like this:

+-----------------------------------------------
| Chris                     ShoppingTripID: 1
| 123 Main Street               CustomerID: 1
| Anytown, CA 90210
+-----------------------------------------------
| Computer   $999.00
| Laptop    $1099.00
+-----------------------------------------------
+-----------------------------------------------
| John                      ShoppingTripID: 2
| 123 Main Street               CustomerID: 3
| Anytown, CA 90210
+-----------------------------------------------
| Ipod       $999.00
| Television $1099.00
+-----------------------------------------------

At the moment, I'm getting this:

+-----------------------------------------------
| Chris                     ShoppingTripID: 1
| 123 Main Street               CustomerID: 1
| Anytown, CA 90210
+-----------------------------------------------
| Chris                     ShoppingTripID: 1
| 123 Main Street               CustomerID: 1
| Anytown, CA 90210
+-----------------------------------------------
| John                      ShoppingTripID: 2
| 123 Main Street               CustomerID: 3
| Anytown, CA 90210
+-----------------------------------------------
| John                      ShoppingTripID: 2
| 123 Main Street               CustomerID: 3
| Anytown, CA 90210
+-----------------------------------------------
| Computer   $999.00
| Laptop    $1099.00
+-----------------------------------------------
| Computer   $999.00
| Laptop    $1099.00
+-----------------------------------------------
| Ipod       $999.00
| Television $1099.00
+-----------------------------------------------
| Ipod       $999.00
| Television $1099.00
+-----------------------------------------------
+2  A: 

Move the main report into the details of the report (broken up into subsections for formatting if necessary), and place the subreport into the details as well.

That way, you'll get a main report (plus subreport) for each user.

Edit

The more I think about it, you probably don't even need a subreport. If you join your shopper and shopping trip tables together in the main report, you can put the shopping trip information in the details, all grouped by the shopper ID.

In the group header, you'll put everything that is currently in your main report.

From here, you can pass the report a list of shopping trip IDs as a parameter, and use this parameter in your Record Selection Formula.

You should end up with something like this (edited 2010/07/25):

+-----------------------
| Report Header 
+-----------------------
| Page Header
+-----------------------
| Group Header (Grouped by **ShoppingTripID**)
|   Display your shopper information here
+-----------------------
| Details
|   Display your shopping trip information 
|   for the shopper here
+-----------------------
| Group Footer
+-----------------------
| Page Footer
+-----------------------
| Report Footer
+-----------------------
LittleBobbyTables
Let me ask for clarification by posing a slight variation on the question:If I make an empty report, and then create a subreport under 'Details A' which contains the main portion of the user report -- how will I get the multiple items to show up under the user -- would the added 'details' section for the multi-line item not need to be a subreport to show all of the items?
C. Griffin
Nested subreports are a really bad idea. In your report, are you searching by shopping trip ID, by shopper ID, or by either?
LittleBobbyTables
My understanding is that I couldn't do nested if I wanted to, so that's why I was looking for a way around that mindset. The initial dataset will be pulled based on a shoppingTripID. Actually, the dataset itself will be a multitude of shoppingTripIDs, not a specific one.
C. Griffin
After re-reading your response, a little light bulb lit up, so I'll post back after trying your suggestion. Thanks!
C. Griffin
This suggestion sounds very much like what I was hoping to hear. It shouldn't be drastically different if I'm using DataSets retrieved from codebehind, rather than the report -- should it? I'm trying it now, but I'm still new to grouping as I've been able to avoid it thus far.
C. Griffin
Okay, I'm getting very close now -- but the grouping either isn't working, or doesn't work the way I expected. Let me edit my post to illustrate what is happening.
C. Griffin
Just to make sure, (1) you are not using a subreport anymore, (2) you have one grouping, which is grouped on Customer ID, and (3) what happens when John has another shopping trip, shopping trip 3? How are you expecting everything to look then?
LittleBobbyTables
I actually want the grouping to be by ShoppingTripID, as the report should be for trips, not customers -- the customer data will be displayed though, along with the multiple items that were purchased for that trip. I do still have the report using subreports, because I see no way to avoid putting the purchased items (of which there are many) on a subreport. Thanks for bearing with me through this question, I really do appreciate the help.
C. Griffin
Okay, so you're grouping by ShoppingTripID. You should still have the shopper information in the Group Header, and the Shopping Trip information in the details. If all those statements are true, then I'm stumped, and tempted to open a bounty on this to get more views/input.
LittleBobbyTables
Your last reply above this, clarified something I was confused about (but didn't know I was confused about). After getting all of the shopper info in the grouped header, grouping by ShoppingTripID, and putting the shopping trip details in its own subreport, this thing finally snapped into shape! Thank you, thank you, THANK YOU!
C. Griffin