Dynamically generate x-axis labels in SSRS Reports
I have two parameters Date Processed from and Date Processed to, based on the selected date range I need to display the months in x-axis of the line chart. Ex: Date Processed From: 9/1/2010 and Date Processed To: 4/1/2011 in X-axis labels I need to display Sep10 Oct10 Nov10 Dec10 Jan11 Feb11 Mar11 Apr11 So that my line graph will be displayed based on the months
September 13th, 2011 8:01am

You can use the Following Expression =MonthName(Month(Fields!OrderDate.Value)) + CStr(Year(Fields!OrderDate.Value)) for grouping so that the month names appear on the axis -------------------------------------------------------- Surender Singh Bhadauria
Free Windows Admin Tool Kit Click here and download it now
September 13th, 2011 8:23am

Hi Iam using SQL Server 2008 R2 and in the Axis Properties i have given the the minimum value : =Month(cDate(parameter!DateFrom.value)) maximum value : =Month(cDate(Parameter!DateTo.Value)) Interval : 1 Interval Type : =Month(cDate(parameter!DateFrom.value)) Now in the preview iam able to see the Month values like 6 7 8 9 etc.. if in the minmum values if i place monthname before month MonthName(Month(cDate(parameter!DateFrom.value)),true) same in maximum value also iam getting blank x-axis
September 13th, 2011 9:26am

Hi likhit, In your case, please refer to the following steps to achieve the requirement: 1. Add two parameters and specify the “Date/Time” as the data type, one parameter is named “DateFrom”, the other is named “DateTo”. 2. Add a Line Chart to the report, and then drag the “Date” field to the “Category Groups” section, drag another field to the “Values” section. 3. In the Category Groups section, click the “Date” field and set the “Label” property like this: =Format(Fields!Date.Value,"MM/yyyy") 4. Right-click on the X-axis and select “Horizontal Axis Properties…”. Set the “Interval” property to 1, and set the “Interval type:” property to “Months”. When preview the report, the result show in the following figure: If you have any more questions, please feel free to ask. Thanks, Bin Long Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
September 23rd, 2011 4:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics