Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Pairing bars in bar chart Post Reply Post New Topic
Author Message
bacham
Newbie
Newbie


Joined: 31 Mar 2009
Online Status: Offline
Posts: 7
Quote bacham Replybullet Topic: Pairing bars in bar chart
     Posted: 31 Mar 2009 at 8:33am
Hi,

I need to display a chart summing up the number of scanned documents for each month of the previous 12 months, side by side with the number of docs from the year before. In other words, my bars look like this:
01/2008
01/2009
02/2008
02/2009
03/2008
03/2009
....

My problem is that I would like the bars for each month to stand out from the neighboring months. In other words, somehting like this:

01/2008
01/2009

02/2008
02/2009

03/2008
03/2009
....
My preferred solution would be to have a gap between each pair of bars for each month. I could also settle with a different color for the months of the previous year (e.g. all bars for 2008 in gray).

Is it possible to do this? I'm using Crystal Reports XI. If there is another type of chart that is more appropriate for such a report, I'm also interested.

Thanks

Hicham


Edited by bacham - 31 Mar 2009 at 8:43am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Mar 2009 at 9:42am
A crosstab might work better.
Use 2 formulas for grouping the data
One formula as "Month":
MonthName(month({table.documentdate}))
Another as "MonthYear":
totext({table.documentdateMM/yyyy")
 
In the crosstab add the the Month as the first grouping in Rows and @MonthYear as the second grouping rows then a SUmmary as a count of the record on a unique record field.
You may have to play with it to get the sorting to work since the Month field will sort alpha...
 
IP IP Logged
bacham
Newbie
Newbie


Joined: 31 Mar 2009
Online Status: Offline
Posts: 7
Quote bacham Replybullet Posted: 31 Mar 2009 at 10:28am
Thanks for the answer!

Actually, I also need to be able to drill-down to the details of a month when I click on a bar. Crystal does this automatically for me with the group layout. Can I also achieve this with a crosstab?

Hicham
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Mar 2009 at 3:29pm
YOu could try a stacked bar chart and see if you can drill down from that.
IP IP Logged
bacham
Newbie
Newbie


Joined: 31 Mar 2009
Online Status: Offline
Posts: 7
Quote bacham Replybullet Posted: 01 Apr 2009 at 2:08am
When I insert my chart, Crystal automatically defines a bar chart with Group layout. If I switch the layout to Advanced, the drill-down doesn't work anymore. The stacked bar chart doesn't work for me because I have only one group. I would have to modify my data source so that I could use it.

I guess I'll just leave it like that for now.

Thanks a lot for your help anyway!

Hicham
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Apr 2009 at 7:37am
This should work...
Create a formula as "MonthYear":
totext({table.documentdate},"MM/yyyy")
Group on this.
Create a Summary Count and insert at GF1
Click on create chart and let it auto create based on this data.
 
SHould give you drill down options striaght from the chart.
I believe you have to have all parts of the chart setup in your group and footer parts for the drill down to function via the chart.
 


Edited by DBlank - 01 Apr 2009 at 7:49am
IP IP Logged
bacham
Newbie
Newbie


Joined: 31 Mar 2009
Online Status: Offline
Posts: 7
Quote bacham Replybullet Posted: 01 Apr 2009 at 8:04am
I think that what you are suggesting is what I already had when I initiated this post (I wish I could show you a picture). It almost looks the way I want it to, except that I want to pair each month (e.g. 02/2008 and 02/2009) either via some extra space between months or via color. Otherwise, it's not apparent that every other bar refers to the previous year.

Hicham

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Apr 2009 at 8:17am
Sorry about that.
I think this may be as close as you are going to get on this with the drill down requirement. If you do not need the drill down the crosstab does a nice job of grouping items so it is very clear or the stacked chart. Unfortunately I do not know how (or if it is possible at all) to drill down from either of these other options.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum