question

Virayanna29 avatar image
0 Votes"
Virayanna29 asked Isabellaz-1451 edited

SSRS 2016 Report Parameter formatting

Is there a way to predefine a parameter box so it accepts pre formatted value?
I wanted to format a text parameter to be 1234-56-789 and give the users a pre formatted parameter box because a lot of times they forget the dash and they don't get what they are looking for in the report.

sql-server-reporting-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RobMills-6716 avatar image
0 Votes"
RobMills-6716 answered Virayanna29 commented

Unfortunately since you can't tell SSRS to use a format string with a text parameter I think your best solution may be to check to see if there are 2 dashes in the right places when the report is submitted. If not add them with an expression before using the value.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I did just that. SSRS needs to consider this feature.

0 Votes 0 ·
Isabellaz-1451 avatar image
0 Votes"
Isabellaz-1451 answered Isabellaz-1451 edited

Hi @Virayanna29,

I am not sure if I see your point, why not create a dateset that formatted already,and use the dateset to fill the parameter.

146415-test.png

Best Regards,
Isabella


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



test.png (42.7 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It would be ok if its just a handful of list of values.

0 Votes 0 ·

Hi @Virayanna29

May be you can use Tsql to generate the range value ?

 declare @leftnum  varchar(20)
 declare @rightnum  varchar(20)
    
    
 set @leftnum =(select cast(left(@parameter,1) as int))
 set @rightnum = (select cast(right(@parameter,1) as int))
    
 print @leftnum
 print @rightnum
    
    
 select num  from dbo.leftTable where num between @leftnum and @rightnum
0 Votes 0 ·