Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crystal Repot graph to show less data than overall Post Reply Post New Topic
Author Message
ebayRR
Newbie
Newbie
Avatar

Joined: 15 May 2011
Online Status: Offline
Posts: 2
Quote ebayRR Replybullet Topic: Crystal Repot graph to show less data than overall
     Posted: 15 May 2011 at 2:43pm
Hi, i have a problem.
I am creating a series of 6 subreports in a main report where the data is displayed as grouped by year and month from 2010 onwards. So first group is year(shows 2010 and 2011) with a yearly chart, second group is month(shows the 12 months for 2010 and 5 months for 2011) with a monthly chart and the metrics for those.
I have a new request for showing the top graph as monthly and not yearly. So i created a year-month field in the command statement using the date field and created the stacked bar chart.
Worked perfectly. shows 17 bars from 2010-01 to 2011-05.
 
Now my problem is that as the months will go by, the chart will become unreadable. So i just want to limit the chart to last 12 months. I cannot use select expect for the rolling 12 months as that will limit the whole subreport to last 12 months. I j ust want the top chart to be year-month for last 12 months. And then i want to see data grouped by year and grouped by months underneath.
 
I approached it in two ways.
One i created formula for l@ast 13 months as follows:
if {Command.DT} > dateadd("m",-13, currentdate) then {Command.MM}
but what it did was give me an extra bar at the beginning for the data that i have skipped. So i changed it to
if {Command.DT} > dateadd("m",-13, currentdate) then {Command.MM} else "2099-01-01" and now i have my chart but i have an additional bar for 2099-01-01. How do i get rid of it?
 
I tried another way where i will create a new metric which is 1 if @last 13 months is 2099-01-01 else 0 and then put it in the chart and summarized it as maximum. then sorted by Bottom N where bottom N is 12 and got the results. This worked fine as in it got rid of the extra bar and then i could format it in white such that the line does not show up. the problem is that that messed up the order of the year-month in my x-axis. what is the point of taking out that bar if now my 2010-04 shows up before 2010-01?
I am at my wits end to solve this. any help will be most appreciated. I can get the last n months as i want but since i am not using it in the select statement, i cannot get rid of the unused data.
How can i say that i have last 17 months but get me only last 12 months and get rid of the rest, not show it up as some other bar?
eBayRR
IP IP Logged
ebayRR
Newbie
Newbie
Avatar

Joined: 15 May 2011
Online Status: Offline
Posts: 2
Quote ebayRR Replybullet Posted: 17 May 2011 at 6:37am

thanks!

Do you know the answer to my query?

 

eBayRR
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 May 2011 at 7:24am

since this is a subreport you cannot have a sub-sub-report so maybe,...

You can group the data in the sub report
place a chart in the group header
suppress the chart with the grouiping of records more than a year old
or
create another subreport in the main report and reduce the data for that to a year and only show the chart as teh content
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