I’m preparing a report in SQL Reporting Services 2012 and I want to show a variable number of charts based on the data I have.
So, the (simplified) data source looks like
ID Name Group Sales
=============================
1 apples fruit 15
2 bananas fruit 25
3 carrots vegetable 10
4 brocolli vegetable 19
5 tuna fish 15
For each group – show a graph based on the names and values:
- chart 1 – fruit sales
- chart 2 – vegetable sales
- chart 3 – fish sales
- and so on…
But I do not want to hard-code the group names – if a new group is added to the db, a new chart should pop-up in the report.
Create a table based on your dataset grouping on “Group” and then embed the chart in the table, SSRS should take care of the rest.