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

Subreport as a summary

Status
Not open for further replies.

Andie

Technical User
Mar 22, 2001
68
US
Is there an easy way to have a subreport that is a summary? Here is the situation.

I have 40 sites. My main report contains daily information for each site during the past month. At the end of each site, there are totals for the month.

I would then like to add a subreport which lists each site and their month totals. The subreport is set up with months as groups, thus the totals are sums of all the days.

I have parameters set for the main report which I would like to pass to the subreport as well. Right now, I have each report separate; no linking. I tried linking and using the parameters but my subreport only produced the final day of the last site.

Any ideas? Thanks.
 
Can you use a cross-tab in the main report instead of a subreport? That is perfect for re-summarizing the data that you already have in the main report. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Ken,
Unfortunately, I can't. Each site receives an individual report showing how they did for each day of the month. Also since there are 40 sites, ~30 days a month, and I look at 4 stats, the cross-tab would get too confusing.

I want to summarize the information at the end for comparison reasons. Like I mentioned, I run essentially two reports. But I would like to simplify this process. In addition, there are times when I would like to select only a few sites. It is cumbersome to change both reports in that case.

But since you mentioned that it is easy to summarize cross-tab information, how would I do that? I figured out how to create cross-tabs and might be able to use that ability more in the future.
Thanks!
 
What are the group fields in the main report. What are the group fields in the subreport.
What do you want the summary to show?
Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
The group field in the main report is "site". The details section contains daily totals for each of 4 fields (numeric). In the group footer, I have also included a subtotal for each field.

The subreport is also grouped on "site". I want the subreport to just list the month totals (subtotal) for each of the 4 columns (numeric) for each site. There should be no daily information shown in the subreport.
 
Add a second group to the subreport that is by month, subtotal the 4 fields by month and then hide the details. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
OK, here's my latest challenge. I can get the data I want if the subreport isn't linked. But I would like to link it so that only the sites and dates that I choose are summarized in the subreport. I have it set up as you suggested, with a month group and totals on that group. I have selection in the main report based on site and date (not using parameters in the main report).

I have tried different combos of linking. They both get data from the same source. If I link on both site and date, I only receive the last detail line from the last site. If I link on just date, I get all sites for the correct time period. If I link on just site, then I get the last site but all dates.

Is there someway to link the reports, so I get the sites I want and the days I want in my subreport? Is it a problem that I want this information in the report footer? I could put it in the report header. It just doesn't make sense to put this information anywhere else.

Thanks!
 
Use parameters in the main report to control your selection, and then link these parameters to the subreport's parameters. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top