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!

charts for different group levels 1

Status
Not open for further replies.

swhitten

Technical User
Sep 3, 2002
191
US
I have a report where the user wants to be able to select the level of subtotaling he sees. He may choose to see each month, the sub-total for the quarters only, or the sub-total for the years only. I did this by inserting the same field (sale date) in Groups 1, 2 and 3. In Group Expert/Change Group Options, for Group 1, I selected "This section will be printed for each year." For Group 2, I selected, "for each quarter." And Group 3 is "for each month."

Then I conditionally suppress two of the three group footers, depending on what the user selects in the Group By parameter field I made. So if user selects Quarter, then Year and Month get suppressed.

All of that works GREAT. But I have one wrinkle. The user wants to see a graph of the data. I put a graph in the header of the report, but it always only shows the graph for the year. I need it to show year, quarter, or month, whichever is being used for the data. I can't get it to show anything but Year. This graph always needs to be at the top of the report.

My work-around is to insert two additional Report Header sections. In one of them, I have a subreport that subtotals by month (same data) and presents the chart for that. I have everything in the subreport hidden in the chart. This Report Header section is suppressed unless user is reportin by month. Same arrangement for Quarter. The Report Header section that contains the actual chart (not a sub report) is suppressed unless the selection is for Year.

I'm afraid this is making the report be much slower than it needs to be. I would like to find a way to have the chart on the main report show the month, quarter, or year data as appropriate.

Ideas? Thanks!
 
I would create a string parameter {?Interval} with options: month, quarter, and year. Then create a formula {@grp} like this:

select {?Interval}
case 'month' : date(year({table.date}),month({table.date}),1)
case 'quarter' : date(year({table.date}),(datepart("q",table.date})*3)-2,1)
case 'year' : date(year({table.date}),1,1)

Insert a group on this formula. Then insert the chart in the report header and select this formula for the 'on change of' field.

-LB
 
LB
Well it only took me a month and half to get back to this project, but finally. Your solution was perfect! I had do some additinal tweaking to get the group name and chart lables formatted correctly; Crystal doesn't do as well with formatting Quarters as it does with months and years.

Thank you for the help! This report works better without the additional subreports.

Sherry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top