Tuesday, March 05, 2013 12:27 PM
I got bit interesting requirement for one of the Chart report.
I was the passing Start date and End date parameters by default it takes 28 days (startdate:01-01-2013 endate:28-01-2013)
on the X-axis it is displaying like Monday 01 01 2013 ,Tuesday 02 01 2013 .......
So Questions are
1) when it display the report first time on X-axis it should display only Mondays 01 2013 Monday 08 2013 ...... I mean only Mondays.
2) when I select longer dates like more than 28 days then only Fridays
is that possible this kind of control in the SSRS ??
Please let me know if anyone have any idea please
Tuesday, March 05, 2013 12:50 PM
To answer the questions:
1. If you make your x axis scalar type, you can specify an interval of 7 days. So if your start date is a monday, the next label will be the next monday. If your start date is a Friday, then the next label will be a Friday because of the 7 day interval.
By the way, 01/01/13 is a Tuesday, not a monday so your example was confusing.
2. You can calculate the difference between the start date and the end date easily and act accordingly if < 28 or > 28 days difference, the question goes back to: what are you going to do if the start date that was entered is neither a monday or a friday? (note: you can adjust the minimum value of the x axis to a monday or friday as well) which means you have to determine what day is the start date and do the math.
You may have to do some validation on your start date vs end date. What if the days between is less than 7 days? start date > end date, should the start date always be the 1st of the month? should the start date always start on a monday or friday? etc..
Please mark as answered or vote helpful if this post help resolved your issue. Thanks!
k r o o t z