Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

MultiValue parameter is only returning one selection when two or more specific selections are made Expand / Collapse
Author
Message
Posted Thursday, February 07, 2013 4:50 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, April 18, 2014 5:07 PM
Points: 24, Visits: 123
Hello,
I am using SSRS in SQL Server 2008 R2 and I have a simple report set up with a single parameter that is set up to return multiple values in a drop-down. There are a total of four options from which to select. When the top option "Select All" is made it correctly returns all of the results. When a single selection is made among any of the four options, it correctly returns results. When I uncheck "Select All" and select the four Division options specifically, it correctly returns the results for all four.

However, the problem comes when two or three specific selections are made from the four, regardless of which ones they are, then it only returns the results associated with the top-most selection made and fails to return the results for the last selection(s) made.

The parameter @DivisionName is populated from a query applying a DISTINCT based on a field called DivisionName. This query is set up in a dataset called Divisions. This is then being applied in a second dataset from which the results are obtained called WeekOutlook. It also contains a field called RegionName and associated with that RegionName field I have added a filter with the following:

Expression is "[DivisionName]
Operator is "In"
Value is [@DivisionName]

The parameter properties for @DivisionName have under the
- General Tab:
"Allow multiple values" checked, Name and Prompt are populated, Visible is selected
- Available Values Tab:
"Get values from a query" is selected, Dataset = Divisions, Value field = DivisionName, Lable field = DivisionName
- Default Values Tab:
"Get values from a query" is selected, Dataset = Divisions, Value field = DivisionName
- Advanced Tab:
"Automatically determine when to refresh" is selected and "Notify...." is checked.

I've tried modifying the query associated with the WeekOutlook dataset to include under the WHERE clause "DivisionName in ([@DivisionName])", but that made no difference and I removed it. I'm trying to avoid doing too much special SQL coding so that it will more intuitive for others less familiar with SQL to modify the reports in the future using the SSRS GUI.

If it will assist, listed below is the query for the Divisions and WeekOutlook datasets:

Divisions:
SELECT DISTINCT d.DivisionName
FROM Tasks AS t INNER JOIN
Division AS d ON t.fk_DivisionID = d.DivisionID INNER JOIN
Region AS r ON t.fk_RegionID = r.RegionID INNER JOIN
Projects AS p ON t.fk_ProjectID = p.ProjectID INNER JOIN
Iterations AS i ON t.fk_IterationID = i.IterationID
WHERE (t.BaselineFinish BETWEEN GETDATE() - DATEPART(dw, GETDATE() - 1) + 1 AND GETDATE() + (7 - DATEPART(dw, GETDATE() - 1)))
ORDER BY d.DivisionName

WeekOutlook:
SELECT     t.ID, t.UniqueID, t.Name, t.Active, d.DivisionName, r.RegionName, t.ScheduleByElement, p.Project_ID, i.Iteration_ID, t.WatchStatus, t.ActualStart, t.ActualFinish, 
t.StartDate, t.FinishDate, t.BaselineStart, t.BaselineFinish, t.Baseline1Start, t.Baseline1Finish, t.Baseline2Start, t.Baseline2Finish, t.Baseline3Start, t.Baseline3Finish,
t.PercentComplete, t.Duration, t.OutlineLevel, t.WBS, t.Milestone, t.Rollup, t.Notes, t.AugmentPhase, t.DeploymentNotes, t.CAPMPriority, t.ResourceNames,
t.ResourceGroup, t.Reason
FROM Tasks AS t INNER JOIN
Division AS d ON t.fk_DivisionID = d.DivisionID INNER JOIN
Region AS r ON t.fk_RegionID = r.RegionID INNER JOIN
Projects AS p ON t.fk_ProjectID = p.ProjectID INNER JOIN
Iterations AS i ON t.fk_IterationID = i.IterationID
WHERE (t.BaselineFinish BETWEEN GETDATE() - DATEPART(dw, GETDATE() - 1) + 1 AND GETDATE() + (7 - DATEPART(dw, GETDATE() - 1)))
ORDER BY d.DivisionName, r.RegionName, p.Project_ID, i.IterationID, t.BaselineFinish


I first checked the forums but could not find an issue quite like this one. Hopefully, I've provided enough information. Thanks in advance for your assistance.



Post #1417391
Posted Thursday, February 07, 2013 4:59 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, April 18, 2014 5:07 PM
Points: 24, Visits: 123
Typing up the details of my issue helped me to see and resolve the problem. The page break was not set up correctly. Now a new page break is taking place as it should following the reults for each division. This was not showing up before.
Post #1417394
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse