Powell
Powell

Reputation: 157

SSRS Dynamic Graphs

Does anyone know if it is possible to create a graph(s) at run time based on the dataset?

To clarify, I have a count of patients suffering from a health condition, split by week. I need to make a graph per condition with weeks on the X axis and patient count on the Y. Nice and easy so far.

The problem is that the number of conditions displayed in the dataset will be different depending on the values entered for the start and end dates for the reporting date range.

With this in mind can I create a single graph then tell it to replicate once for each condition returned and only look at the data for that specific condition?

The graphs can't appear in rows as they must aggregate data from multiple rows (where the condition is the same) and plot the various count values over week numbers (the dataset returns a count, a week number and a condition with a group by on the week number and condition)

As an added challenge none of this can be hard coded as the single report has to work across multiple sites.

Thanks

P

Upvotes: 2

Views: 2784

Answers (1)

EastOfJupiter
EastOfJupiter

Reputation: 781

Yes this is possible by first dropping a "Matrix" control into the report surface. With the Matrix control, you're able to display groups of data. In this case, your group will be the condition returned in your DataSet. Each group will have an embedded chart which will display data the same way, but only the data within the grouping you choose.

Step 1: Add a Matrix control to your report surface. Create a Row Group based on Condition (In my example, Year)

enter image description here

Step 2: Right Click the empty column on the right side of the Matrix control, and choose the option for Insert Column > Outside Group - Right. Then Delete the middle column.

enter image description here

Step 3: Right click the Right columns "Data" cell (which should be outside the grouping) and choose Insert > Chart. Select the desired chart type.

enter image description here

Step 4: Resize the column and row to view the chart in more detail. Edit the Chart Data to aggregate what you're wanting to show as the line, and pick your category groups.

enter image description here

Step 5: Test, and revist whichever step above needs adjusting.

enter image description here

Upvotes: 4

Related Questions