0
votes

My SSRS report displays a date range (2 parameters) and a multi-selectable value parameter for a field called "MeterNumber".

What I want is for the default value of the multi-selectable parameter to show ALL values until the user specifies one of the values in the list.

I've tried doing this by setting the general tab in the parameter properties to "Allow Multiple Values", and the Available and Default values to equaling the same value fields from the same dataset, but no go.

Any thoughts?

4
Did you set a default value for @StartDate and @EndDate parameters?alejandro zuleta
@alejandrozuleta Yes. @ StartDate defaults to the first day of the month and @ EndDate defaults to the last day of the month.Byronyk

4 Answers

0
votes

You can use the same dataset that populates the Available Values of the parameter, to populate the Default Values of the parameter.

Then by default, all values are selected when the user first opens the report.

0
votes

You can assign minimum date and maximum date in your back-end if your date start and date end is empty or null (remember the min date in sql is 1/1/1753 12:00:00 AM and max date is 12/31/9999 11:59:59 PM so your date format should be like that). So when its passed on your parameter it will get all the data within that minimum start date and maximum end date.

This is how you are going to assign min date time in c#

DateTime dateStart = SqlDateTime.MinValue.Value;

and max date

DateTime dateEnd = SqlDateTime.MaxValue.Value;
0
votes

Do you have any blank and/or null values for MeterNumber in the dataset? This can cause issues with Parameter values. Since in your case you need multiple values, then you can't have null values. Just make sure Allow blank value ("") and Allow multiple values are selected. Then, make sure you don't have NULL values in the MeterNumber column. If you do, then convert to empty string, i.e., ISNULL(AC.MeterNumber, '') as MeterNumber

0
votes

Just had the exact same problem @Byronyk, however just realised what the issue was (Also aware this post is very old, this is more for those who stumble upon this!)

The issue I found was that I had one extra Value in the available values than in the Default Values, and as such it threw out the default selections.

Once I realised and added it in, the default values were selected again.

I suspect this is the issue, as the date worked fine, the issue was in the 'MeterNumber' parameter