The issue lies in the query asking for the EnforcementState but ultimately doing nothing with it.
We're going to have to pass the specific EnforcementState to the other report so it can be compared
- Open the report "Application deployment status" from under "Software Distribution - Application Monitoring - Hidden" (Details View shows hidden items) in Report Builder.
- Scroll right and click the cell that currently contains [Total], this is a textbox named Total.
- Edit the Action property by clicking the elipsis "...".
- Under the Action node click Add to add a Parameter names EnforcementState and a value of [EnforcementState], this value is already being pulled, but not sent to the detail report until now. Click Ok and save the report.
The first report is now finished. When you click on a number under the Assets column you are now sending that EnforcementState parameter to the details report, if you just tried it you certainly get an error. The details report doesn't know what to do with this parameter.
- Open the report "Application deployment detailed status" from under "Software Distribution - Application Monitoring - Hidden"
- Right-click on Parameters and click Add Parameter
- Name this EnforcementState with a Prompt of EnforcementState, visibility should either be Visible or Hidden (visible only matters when a parameter isn't passed into the report, which ours is passed from the eariler steps)
- Expand Datasets and right-click on DataSet1 and select Dataset Properties
- In the Query pane scroll past the first SELECT, begin, and second SELECT. The area we are changing is in the query's second WHERE section. Add the following to the end: AND (AppState.EnforcementState = @EnforcementState). This will make your WHERE clause look like the following.
WHERE
(AppState.PolicyModelID = @PolicyModelID) AND
(AppState.AssignmentID = @AssignmentID) AND
(AppState.StatusType = @StatusType) AND
(AppState.StatusType = AppState.AppStatusType) AND
(@DT = 0 OR AppState.DTCI = @DT) AND
(AppState.EnforcementState = @EnforcementState)
else if @StatusType = 3
Add this, AND (AppState.EnforcementState = @EnforcementState), to the next WHERE statement as well. Skip the following one, as StatusType 4 is Unknown, and add it to the last WHERE as well. Click OK and save the report. You may have to refresh the page
if you're currently viewing this report in your browser but this will now show specifically the assets you wanted to see.