Solved

SSRS - Want to display the same chart multiple times based on DB result

Posted on 2013-12-23
5
3,191 Views
Last Modified: 2014-02-05
Hi, i am relatively new to SSRS, but not new to development or SQL Server. I have a project to create some executive reporting and was wonding if what i want to do is possible.

I have a pie chart that i create which is based on City, the chart shows a breakdown of inventory per city. So for example, in Miami there are 10 of item 1, 15 of item 2, 4 of item 3, etc.

My DB query returns the inventory counts grouped by city.

Is there a way to repeat the same pie chart on a report multiple times, dynamically driven by the data set? If my data set only had results for Miami and JAcksonville, i would have two charts. If it returned Miami, jacksonville, orlando, pensacola, and tampa there would be 5 charts.

Is this possible in SSRS or do all the charts / reports need to be pre-defined? IF its possible how would it be done? FYI this is SSRS 2012 and i am currently using the report builder.

Thanks in advance
Mike
0
Comment
Question by:mikegrad7
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:vr6r
ID: 39736741
Yes, SSRS can do that easily.  All you need to do is include the chart in the detail section of your report.  For example in your case your report will be grouped by city, so in the detail section where your inventory rows would go, just drag a chart control from the toolbox into that detail section.  

The values for the chart will be automatically set from the current row in your dataset - all you need to do is select which dataset rows you want the chart to display.
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39737436
vr6r's comment is right except for a small part: charts cannot be nested in a detail section of a tablix.  So to be able to nest the chart you first need to add a group to this detail section.  In the Row Groups pane double-click the (Details) item and add a group there.  The trick here is to group on the lowest level in your table.  In your case that would be City (or CityID if you've got that?).
0
 
LVL 1

Author Comment

by:mikegrad7
ID: 39742518
So if i add a chart to the group in the detail section, it will create a chart for every group? This sounds like what i am looking for, but i am skeptical on what the layout might look like. Ill give it a try and see what happens.
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 39744538
"So if i add a chart to the group in the detail section, it will create a chart for every group?"

Exactly!  The easiest is to try it out, you'll see immediately how it works out.  Just create the chart as if it wasn't nested in a table, it works identical.
0
 
LVL 1

Author Closing Comment

by:mikegrad7
ID: 39836070
Thanks! Did the trick!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: This article is aimed at report developers who are used to developing reports using relational databases and have gotten a first-time assignment to develop reports on OLAP cubes. It demonstrates how to build a report using SQL Ser…
How to use Variables  and Custom code in SSRS report and Assembly reference to use compile shared code in SSRS. Its big question for all who are working with SSRS. It is easy to create assembly and refer in SSRS report, still there are some steps…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question