Home > SSRS > How to set DateFrom and DateTo values on X axis in SSRS report

How to set DateFrom and DateTo values on X axis in SSRS report

I got this question from MSDN, link here.

User Comment:-

I am currently creating chart to display data from data set, want to display x axis margin start and end value based on the user selected value from the drop down.

I want to display Date only for example if DateFrom = ’01/03/2015′ and DateTo=’30/03/2015′

Want to display on xaxis 123456..30etc, How can this be achieved?

Lets create sample report, create two date parameters FromDate and ToDate.

Lets drag the chart to report body.

Go to X-Axis chart property by right click in X-axis as shown in below screen:-

HorizontalAxisProperties

Configure the settings as using below screen:-

HorizontalAxisPropertiesSettings

Axis Type:- Scalar

Axis Range and interval

Minimum :- =Day(Parameters!DateFrom.Value)

Maximum:- =Day(Parameters!DateTo.Value)

interval:- 1

Interval Type:- Number

After setting above things just run the report, you will see report screen as below:-

Report

lets change values in parameter and run the report again:-

Report1

Hence its working as desired requirement.

Thanks
Prasad

Learn Different BI Tools
Subscribe my YouTube Channel : BI Tools

Advertisements
Categories: SSRS Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: