Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
hbadministrator
Posting Yak Master
120 Posts |
Posted - 2014-10-01 : 11:18:49
|
I have a report that has 5 datasets the first one is the primary that has 4 fields with a where statement (see below). Then every other dataset is each field with a group by (see below). Using SSRS I am trying to get each field to be a multi select parameter. Ideally having each parameter show up as a Default Value as Blank (checkbox) and then they can choose each Parameter they want to use for the query would be great. Any help is greatly appreciated. Example: First selection would be salesperson 3 people and Division and I want to leave Department and Territory Blank. Second Example: I just want to see All Salesperson's and Division, Department and Territory are blank Multi value parameters. Dataset 1SELECT [Slspn-Code] ,[SerDeparment] ,[Divcode] ,[Territory] FROM [Service].[dbo].[TechServiceDetails]WHERE ([Slspn-Code] IN (@Slspn)) OR (SerDeparment IN (@SerDeprment)) OR (Divcode IN (@Divcode)) OR (Territory IN (@Territory))Dataset 2SELECT [Slspn-Code]FROM TechServiceDetailsGROUP BY [Slspn-Code]Dataset 3SELECT SerDeparmentFROM TechServiceDetailsGROUP BY SerDeparmentDataset 4SELECT DivcodeFROM TechServiceDetailsGROUP BY DivcodeDataset 5SELECT TerritoryFROM TechServiceDetailsGROUP BY Territory |
|
hbadministrator
Posting Yak Master
120 Posts |
Posted - 2014-10-07 : 08:15:05
|
I was able to answer my own question. Walking away for a bit and coming back helped. So to fix this issue since we are using SSRS I needed to create Union's on Dataset 2,3,4,5 and remove the Group by. This creates a field blank so when I actually use the query from Dataset 1 I can select Blank and still use the other Parameters. In ssrs make sure you go to Parameter Properties and select Allow Multiple Values and then go under Available Values select the corresponding Dataset. Dataset 2SELECT [Slspn-Code]FROM TechServiceDetailsUnion Select '(BLANK)' AS [Slspn-Code]Dataset 3 SELECT SerDeparmentFROM TechServiceDetailsUnion Select '(BLANK)' AS SerDeparmentDataset 4SELECT DivcodeFROM TechServiceDetailsUnion Select '(BLANK)' AS DivcodeDataset 5SELECT TerritoryFROM TechServiceDetailsUnion Select '(BLANK)' AS Territory |
|
|
|
|
|