Solved

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

Posted on 2013-12-23
5
3,327 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Written by Valentino Vranken. A while ago I wrote an article called Chart Optimization Tips (http://www.experts-exchange.com/articles/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Chart-Optimization-Tips.html).  This article explained how …
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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