CR 8.5 Crystal Reports chart (charting, chart expert) legend question.
Posted on 2004-10-22
I am having a difficult time trying to figure out how to do a specific chart in Crystal Reports 8.5. I have the data that I want to use, but can't figure out how to make the pie chart, and especially the legend, look the way I want.
Sample data (returned from Access parameterized query, ordered using a SQL "order by" clause like this: ORDER BY Sold DESC, Fruit):
I want a pie chart. Each slice is a different fruit. (That I can do.) I want the legend to show the data just as the above sample data (except with percentages, rather than Sold.) So the legend *should* look like this:
The problem is that the legend shows the fruit in alphabetical order, not in order by the highest percentage. How do I get the legend to display the fruit in the proper order, by the highest value first?
You may not need this, but...
I realize that sometimes when I try to give a simple example, the example may be oversimplified to the point where it is hard to get a grasp on the actual problem. So, just in case, here's the actual parameterized query from Access (which contains a subquery.) I'm actually looking between a date range for groupID that has a minimum number of hits:
PARAMETERS [Date1] DateTime, [Date2] DateTime, [MinHits] Long;
SELECT tblSession.dtmSessionDate, tblGroupName.strGroupName, TotalHits
FROM (SELECT tblSession.dtmSessionDate, tblGroupName.strGroupName, Count(tblSessionDetail.pk_lngGroupID) AS TotalHits
FROM tblSession INNER JOIN (tblGroupName INNER JOIN tblSessionDetail ON tblGroupName.pk_lngGroupID = tblSessionDetail.pk_lngGroupID) ON tblSession.pk_lngSessionID = tblSessionDetail.pk_lngSessionID
WHERE (((tblSession.dtmSessionDate) Between [Date1] And [Date2]) AND ((tblGroupName.pk_intGroupNameID)=1))
GROUP BY tblSession.dtmSessionDate, tblGroupName.strGroupName
ORDER BY Count(tblSessionDetail.pk_lngGroupID) DESC)
WHERE (TotalHits >= [MinHits])
ORDER BY TotalHits DESC, strGroupName;