Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Отчетные системы [игнор отключен] [закрыт для гостей] / Вопрос по фильтр для Dataset в SSRS / 3 сообщений из 3, страница 1 из 1
13.02.2012, 11:11
    #37658567
blander
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Вопрос по фильтр для Dataset в SSRS
Добрый день!
Подскажите плиз как в фильтре для DataSet правильно сделать условие выборки "или"? Что бы в отчет попадали строки содержащие по определённому полю набор значений а не только одно?
...
Рейтинг: 0 / 0
13.02.2012, 11:28
    #37658598
tarrus
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Вопрос по фильтр для Dataset в SSRS
blander,

Используйте Or в выражении для Value
...
Рейтинг: 0 / 0
13.02.2012, 18:51
    #37659738
user89
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Вопрос по фильтр для Dataset в SSRS
blander,
не совсем понятно...
На всякий случай, как MultiValue параметр передать в процедуру
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
I used the MS example of checking the multi checkbox for the parameter and then using a WHERE Column IN (@MultiParam)

Есть 2 пути: Filter метод (не очень быстрый) и SQL метод (эффективнее)

Filter Method (не очень быстрый)
Create a multi-value parameter.  Let's call it @Animals and you select Dog, Cat, Bird (or Select All) 
Your main Dataset, which will return a result set to your report, does not reference @Animals in it's where clause. 
Instead, click on Dataset Properties and select Filters 
In the Filter setup dialog, click on the column in your result set that corresponds to the Animal value. 
For the operator, select the "In" operator 
For the value, type in [@Animals] 
Done! 

This will "post-filter" your SQL query and only return the values that have been filtered by your multi-value parameter.
Only Dog, Cat, Bird records will return to your report.  The downside to this approach is that the processing occurs at the Report Server level 
and not by your Database server, because you are not using SQL to do the work.  In many cases (most cases!) I find this the easiest and quickest way
to do what you want.



SQL Method (эффективнее)
Create a multi-value parameter.  Let's call it @Animals and you select Dog, Cat, Bird (or Select All).  Same as the Filter Method! 
You will need a stored procedure for your main report Result Dataset.  Let's call it sp_get_animals. 
sp_get_animals will take one argument, @Animals, so the calling mechanism looks like this:  exec sp_get_animals @Animals 
When you are configuring your parameters in the Query dialog, use the following expression to define the value of your parameter:
=join(Parameters!Animals.Value,",") 
This will create a string that looks like this:  "Bird,Dog,Cat" 
In the body of your stored procedure, you will have to parse @Animals to pick off Bird, Dog, Cat. 
Once you have parsed @Animals, you can use the SQL IN clause to actually process it. 


Т.е. по русски:
Тогда с помощью Expression вы можете сформировать строку со всеми выбраннымии Value параметра и передать ее в хранимку.
=Join(Parameters!<ParameterName>.Value,", ") - Выражение, объединяющее в одну строку все значения в массиве многозначного параметра типа String.
А в хранимке выполняйте парсинг и обрабатывайте дальше, как вам нужно.
...
Рейтинг: 0 / 0
Форумы / Отчетные системы [игнор отключен] [закрыт для гостей] / Вопрос по фильтр для Dataset в SSRS / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]