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!

Aggregate subreport data?

Status
Not open for further replies.

Bennie47250

Programmer
Nov 8, 2001
515
0
0
US
Using crystal 7.0

I’m fairly certain the answer is no, but wanted to verify

To check on orders booked for the month, we need to run 3 different reports as the information is coming from different tables. So that we only need to run the report once, added 2 of the reports to the report footer (RF a and RF b)as sub-reports.

It is possible for the some customer to be in all 3 reports so to determine the total orders booked for the customers, we are exporting to Excel and then creating a pivot table to sum records by the customer.

Here is the question, is it possible to aggregate, group and total the data from the 3 reports in Crystal?

Thanks
Bennie
 
If you have a unique ID on the customer, and I assume you do since you are aggregating in the Excel file, can't you link your tables together using that and do the summary info in one report?

Alternatively, have you attempted inserting a group on the customerID and using shared variables to summarize the order info using the subreports?
 
Do the subreports all run in a group header for each customer?

If you CAN create shared variables IN CR 7,you can sum the values from each sub report. Not sure CR had the concept for shared vars in such an old product.

Just because the data is in different tables that does not mean you have to have a sub report for each table. YOu can join the tables together and then just have all the data in one report!

Ian
 
GMcNamara, Yes all the reports have unique ID's (the customer #) but the same customer may not be on all 3 reports. No I have not attempted to group on the Customer # and use shared variables to do this. Sounds too complicated.

IanWaterman, Yes version 7 does have shared variables, but again not sure how to do what you are suggesting. The reason I'm using 3 reports total is because the select criteria is different for each of the reports and to put all the tables together would be difficult.

Thanks for the suggestions to date.
 
GMcNamara has suggested the way to go--You could create a group on the customer ID and place the subs in a group header section, and link them to the main report on ID. Then you could use shared variables to do simple sums of the results from each sub within each group. All you have to do is within each sub create a shared variable to be placed in the subreport footer:

whileprintingrecords;
shared numbervar orders1 := count({table.orders}); //or sum?

Do this for each sub, naming the variabls something different in each, e.g., orders2, orders3. Then in the group footer_a section, use a formula like this:

whileprintingrecords;
shared numbervar orders1;
shared numbervar orders2;
shared numbervar orders3;
orders1 + orders2 + orders3;

In Group footer_b, place a reset formula:
whileprintingrecords;
shared numbervar orders1 := 0;
shared numbervar orders2 := 0;
shared numbervar orders3 := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top