In this article, I will discuss how to add chart controls to reports defined in SSRS.
To work with this, I will use a sample report which I showcased in my article, Basics of SSRS.
Below is the step by step process to work on this sample:
- Generate & define SSRS report
- Add Chart Control to report
- Set Datasource to Chart Control
- Define Fields to be used by Chart Control
Generate & Define SSRS Report
- Once you generate & define your report, the report will look similar to that shown below. Here I have generated a report based on my article “Basics of SSRS”.
Add Chart Control to Report
- To add chart control, click on Design tab.
- Now go to menu items select View, select Report data:
- Select toolbox from “Report Data” as shown below:
- Now from Report Items, double click “Chart”, which will show list of charts available. From this list, let’s select first chart control & click ok button.
- Now chart control will be added to the report. So now let's align it properly to the right:
Set Datasource to Chart Control
- To set datasource, right click chart control, select Chart, select Chart Properties as shown below:
- Now this shows up a window as shown below. So let's select / change values accordingly. The
datasource that I have selected is
DataSet1, as this is the same source used by report (see in
- After setting the values, click ok button.
Define Fields to be used by Chart Control
- To set fields to the chart control, move mouse pointer to “Drop data fields here”, “Drop series fields here” & “Drop category fields here” section.
- When you move mouse pointer to the above mentioned sections, a small image is shown in the right corner of sections (see Drop data fields here). Click the image which will show up the fields specific to
Dataset which you have assigned in one of our above steps.
- In my case, I have added field in “Drop data fields” & “Drop Series fields”. After adding fields, save it & go to “Preview” tab which should show up data similar to below:
Don't forget to rate the article if it helped!
Happy coding, hope this helps!
B.Tech graduate in CSE, having 5+ years of experience in .Net related Technologies & Microsoft Certified Professional.
My interests are Coding, Writing complex Queries [like d most], reading [technical stuff] and listening to music, playing Cricket, Table Tennis.