0
votes

When my month Parameter's Value and Label fields are not the same the default value assigned does not display correctly on the filter bar.

Available Values

When viewing the report the Month filter shows as in the image. IncorrectFilterView

When I make both the Value and Label fields the same the Month filter shows as in this image.CorrectFilterView

The expression I use for the Default value is: =Format(DATEADD(DateInterval.Month,-1,Today),"MMM")

I have also tried: =DATEADD(DateInterval.Month,-1,Today)

I can continue bit both the Value and Label fields being set to MonthShort, but this makes getting the month number a mission in some of my calculations.

I'm also considering adding another hidden param just for the number.

1
Default values are a pain in SSRS.. once the default value is loaded by SSRS and if you change your parent parameter, the child parameter does not refresh correctly.. apparently this is by design (according to MS).. check out this link .. bpmsbi.wordpress.com/2011/04/23/… - Harry
That's interesting, it kind of makes sense, but I feel they could have just added an additional flag to enable or disable that refresh (I'm not a developer :p). In my current scenario, however, my main issue is that what I set on the Default Values tab of the parameter properties does not act as expected, when the label and value fields are different as in the above screenshot. But when I make both MonthShort and I set my default value to eg. "Dec" it works fine. - Petri

1 Answers

0
votes

Your default value should the the same type as the 'Value' field not the label field.

Just change the default expression to

=Format(DATEADD(DateInterval.Month,-1,Today),"MM")

this will give you 12 rather tyan 'Dec'. The parameter will show as 'Dec' in the dropdown list though as 'Dec' is the label for 12.

Remember, the parameters label property is primarily there for the user, the report always uses the Value field.

You may also want to consider chaning the sort order to the MonthNumber field too.