Converting Crystal Reports to SSRS Reports
My issue is with converting multi-value parameters:
In Crystal Reports, you can set a parameter to accept multiple vales (Discrete, Range or Discrete and Range).
As an example:
I have a database table with a column called ID.
I can create a parameter called param_id and set the options of the parameter to"Allowmultiple range values".
With this setup, I can limitthe result set of the report by comparing theparam_id parameter to the ID column in the database. Because param_id is a multi-value range parameter,I can pass it the following data:
1 - 50
60 - 80
150 - 127
This will only return results within those ranges.
Does anyone know if SSRS provides this kind of functionality?
Thanks,
Patrick Conway
March 27th, 2008 5:30pm
In SSRS , there is an option called multi-value. If you set this to true, user has the option of selecting multiple values
Free Windows Admin Tool Kit Click here and download it now
March 27th, 2008 6:38pm
You are correct, you can set a parameter to accept multiple values. You can then use those values inthe where of the query. The problem is that the "multiple values"are distinct - there is no range (that I can find).The query that isexecuted wouldbe something like this:
Select .....
.
.
Where tlbX.ID in ('val1','val2','val3')
.
.
If you had 2 parameters and turned theIN clause to aBETWEEN, you would still only get a single range.
I am looking for a solution that will take 1 to many ranges .
Any ideas?
Patrick
March 27th, 2008 7:00pm
now I understood what you problem is.
However, there is no direct way of doing.
But you can do work around. you can list the value by using a query and change the data set accordingly. seems not an easy task
Free Windows Admin Tool Kit Click here and download it now
March 27th, 2008 7:08pm
Thanks for you input Dinesh,
I didn't think there was a way but I thought I would put the question out there.
Cheers,
Patrick
March 27th, 2008 7:51pm
You could set up a multi value parameter, with values and labels like this:
@RangeParameter
Value Label
1 1-10
2 11-20
3 21-30
...
And then in the SQL statement, add this to the WHERE clause:
Where ((@RangeParameter = 1 and RangeValue Between 1 and 10)
or (@RangeParameter = 2 and RangeValue Between 11 and 20)
or (@RangeParameter = 3 and RangeValueBetween 21 and 30) )
(RangeValue being the field in the database that you are "ranging")
Hope that helps
BobP
Free Windows Admin Tool Kit Click here and download it now
March 27th, 2008 11:43pm
Hey Bob,
Thanks foryour answer.
I thought about taking this approach but I need to accommodate for 'n' ranges. There could be a single value or there could be 10 ranges. I don't want to clutter the UI with lots of input boxes..... Not so easy.
My not so easy answer is to do some custom coding around the values that are input. I plan to use the same approach as the Microsoft Word Print dialog. There is a "Page range" section that allows you to "Enter page numbers and/or page ranges separated by commas" Eg: 1,3,5,7-12,25-29.
I plan to use a stored procedure to gather my dataset - passing the user generated string as a parameter. I am writing a .NET class (User defined function)that I will load into SQL (SQLCLR) to parse the string and create a table with the results (breaking the ranges into actual values). The resulting tablewill beused in a where clause (where @rangeParameter in (select id from tempTable)).
With any luck, this will work... not straight forward, but easier than disappointing all my users.
Thanks again for your input.
March 28th, 2008 1:08am
I am planning to convert all my Crystal Reports to SSRS 2005. Can anyone tell me what is the easiest way to do it. Thanks!
Free Windows Admin Tool Kit Click here and download it now
December 10th, 2010 11:20am
http://www.crystalmigrater.com/Default.aspx
Thanks
KumarKG
December 10th, 2010 11:21am