本文转自:https://docs.microsoft.com/en-us/sql/reporting-services/report-design/charts-report-builder-and-ssrs

Read about using chart data regions to help readers of your Reporting Services paginated reports understand large volumes of aggregated data at a glance.

The more time you spend carefully preparing and understanding your data before you create a chart, the easier it will be to design your charts quickly and efficiently. For help choosing which chart to use, see Chart Types To start experimenting with charts immediately, see the bar, column, sparkline, and pie chart tutorials in Report Builder Tutorials.

The following illustration shows many of the different elements used in the chart.

You can publish charts separately from a report as report parts. For more information, see Report Parts.

Designing a Chart

After you add a chart data region to the design surface, you can drag report dataset fields for numeric and non-numeric data to the Chart Data pane of the chart. When you click the chart on the design surface, the Chart Data pane appears, with three areas—Category Groups, Series Groups, and Values. If the report has a shared or embedded dataset, the fields in the dataset appear in the Report Data pane. Drag fields from the dataset into the appropriate area of the Chart Data pane. By default, when a field is added to one of the areas of the chart, Reporting Services calculates an aggregate for the field. You can also use series grouping to dynamically generate series. A chart is organized like a matrix.

Note

The data in the chart at design time is different from the data in the chart when the report is processed. It is not your real data. It is generated data that has been added so that you can design your chart with an idea of what the chart will look like.

How a Chart is like a Matrix

One way to think about how charts work is to compare them to matrices.

Conceptually, their organization is identical:

  • The Columns group in the matrix is like the Category Groups area in the chart.

  • The Rows group in the matrix is like the Series Groups area in the chart.

  • The Data area in the matrix is like the Values area in the chart.

Adding Data to the Chart

Suppose you have a report that shows Sales by Name. You drop the Full Name field to the Category Groups area and the Sales field to the Values area.

When you add the Sales field to the Values area, the text of the data field appears in the legend, and the data from this numeric field will be aggregated into one value. By default, the value is aggregated using the built-in function Sum. The Chart Data pane will contain a simple expression for your field. In our example, [Sum(Sales)] will appear for the field expression =Sum(Fields!Sales.Value). If no groups are specified, the chart will only show one data point. In order to show multiple data points, you must group your data by adding a grouping field. When you add the Name field to the Category Groups area, a grouping field of the same name as the name of the field is automatically added to the chart. When fields that define the values along the x and y axes are added, the chart has enough information to plot the data correctly.

When the Series Groups area is left empty, the number of series is fixed at design time. In this example, Sales is the only series that appears on the chart.

Category and Series Groups in a Chart

A chart supports nested category and series groups. Charts do not display detail data. Add groups to a chart by dragging dataset fields to the category and series drop zones for a selected chart.

Shape charts such as pie charts support category groups and nested category groups. Other charts such as bar charts support category groups and series groups. You can nest groups, but make sure that the numbers of categories or series do not obscure the presentation of information in the chart.

Adding Series Grouping to a Chart

If you add a field to the Series Groups area, the number of series depends on the data that is contained in that field. In our earlier example, suppose you add a Year field to the Series Groups area. The number of values in the Year field will determine how many series will appear on the chart. If the Year field contains the years 2004, 2005, and 2006, the chart will display three series for every field in the Values area.

Dataset Considerations Before Creating a Chart

Charts provide a summary view of your data. However, with large datasets, the information on a chart can become obscured or unreadable. Missing or null data points, data types ill-suited to the type of chart, and advanced applications such as combining charts with tables can all affect the readability of a chart. Before designing a chart, you should carefully prepare and understand your data so that you can design your charts quickly and efficiently.

You can have as many charts in your report as you want. A chart, like any other data region such as a matrix or table, is bound to a single dataset. If you want to display multiple datasets on the same chart, you can create an additional dataset that uses a JOIN or UNION statement in your SQL query before adding data to the chart. For more information about the JOIN and UNION statement, see Books Online or another SQL reference.

Consider pre-aggregating data in the dataset query if detail data is not necessary or useful. To display each data point more clearly, reduce the number of categories in your dataset. You can filter the dataset or add a condition to your query that reduces the number of rows returned.

Best Practices When Displaying Data in a Chart

Charts are most effective when the number of elements that are displayed presents a clear image of the underlying information. Some charts, like scatter graphs, benefit from numerous data points, while others, like pie charts, are more effective with fewer data points. Choose a chart type carefully based on the values in your dataset and how you want this information to be shown. For more information, see Chart Types (Report Builder and SSRS).

There are several ways you can consolidate data on a chart:

  • When using a pie chart, collect small slices into one slice called "Other." This will reduce the number of slices on your pie chart. For more information, see Collect Small Slices on a Pie Chart (Report Builder and SSRS).

  • Avoid using data point labels when there are numerous data points. Data point labels are most effective when there are only a few points on the chart.

  • Filter unwanted or irrelevant data. This helps you highlight the key data that you are trying to show on the chart. To filter data points in a chart, set a filter on a category group or a series group. By default, the chart uses the built-in function Sum to aggregate values that belong to the same group into an individual data point in the series. If you change the aggregate function of a series, you must also change the aggregate function in the filter expression. For more information, see Filter, Group, and Sort Data (Report Builder and SSRS).

  • To display ratio data in a table or matrix template, consider using a linear gauge instead of a bar graph. Gauges are better suited for showing a single value inside a cell. For more information, see Nested Data Regions (Report Builder and SSRS).

Aggregating Values from a Data Field on the Chart

By default, when a field is added to the Values area of the chart, Reporting Services calculates an aggregate for the field. If you drag a field onto the chart without dropping the field into a specific area, the chart will determine whether this field belongs on the category (x) axis or value (y) axis based on the data type of the field. Numeric fields that are dropped in the Values area are aggregated using the SUM function. If the data type of your value field is String in the Values area, the chart cannot display a numeric value, even if there are numbers in the fields, so the chart displays the COUNT function. To avoid this behavior, make sure that the fields that you use have numeric data types, instead of Strings that contain formatted numbers. You can use a Visual Basic expression to convert String values to a numeric data type using the CDbl or CInt constant. For example, the following complex expression converts a field that is named MyField that contains numeric values that are formatted as Strings.

=Sum(CDbl(Fields!MyField.Value))

For more information about aggregate expressions, see Aggregate Functions Reference (Report Builder and SSRS).

In This Section

Add a Chart to a Report (Report Builder and SSRS) Describes the first steps in adding a chart to your report.

Chart Types (Report Builder and SSRS) Describes all of the chart types and sub-types available in Reporting Services, including considerations and best practices for using various chart types.

Formatting a Chart (Report Builder and SSRS) Use formatting to improve the overall appearance and highlight key data points of your chart.

Empty and Null Data Points in Charts (Report Builder and SSRS) Describes considerations when working with charts based on fields with empty or null values.

Displaying a Series with Multiple Data Ranges on a Chart (Report Builder and SSRS) Describes how to add scale breaks to a series that contains more than one range of data.

Multiple Series on a Chart (Report Builder and SSRS) Describes several methods of showing multiple series on the same chart, including combining chart types, using the secondary axis, specifying different chart types and using multiple chart areas.

Linking Multiple Data Regions to the Same Dataset (Report Builder and SSRS) Provide different views of data from the same report dataset.

Add or Delete a Group in a Chart (Report Builder and SSRS) Describes adding groups and nested groups to a chart.

Add a Moving Average to a Chart (Report Builder and SSRS) Describes using the Moving Average formula to calculate the average of the data in your series.

Troubleshoot Charts (Report Builder and SSRS) Describes tips for working with charts.

See Also

Images, Text Boxes, Rectangles, and Lines (Report Builder and SSRS) Interactive Sort, Document Maps, and Links (Report Builder and SSRS) Nested Data Regions (Report Builder and SSRS) Tutorial: Add a Column Chart to Your Report (Report Builder) Tutorial: Add a Pie Chart to Your Report (Report Builder) Tutorial: Add a Bar Chart to Your Report (Report Builder)

[转]Charts (Report Builder and SSRS)的更多相关文章

  1. SQL Server 2008 R2 升级到 Service Pack 3后Report Builder启动不了

    一同事将测试服务器从SQL Server 2008 R2 SP2升级到了SQL Server 2008 R2 SP3后发现Report Service的报表编辑时启动不了Report Builder, ...

  2. SQL报表(Report Builder)里面的几个常见问题(持续更新)

    一 SQL报表常常会遇到在表格中的相除,如果分母为零,一般会显示错误号,我们可以这么处理:(加上是A/B) ,, B) 但是我们不能这么写: ,,A/B) //我们不能这么写,会产生BUG,至于什么B ...

  3. Java服务器端生成报告文档:使用SQL Server Report Service(SSRS)

    SQL Server Report Service(SSRS)提供了Asp.Net和WinForm两类客户端组件封装,因此使用C#实现SSRS报表的导出功能,仅需要使用相应的组件即可. Java操作S ...

  4. win10系统下使用EDGE浏览器找不到Report Builder 启动图标

    Win10系统下如果要使用Report Builder,可能存在EDGE浏览器或者Chrome找不到ReportBuilder的启动图标的情况,此时,应以管理员权限运行IE浏览器,即可看到图标.

  5. 报表工具Report Builder 3.0的安装

    工作后第一次尝试独立安装一个软件啊 话不多说,总结一下过程 前言:已经Baidu了Report Builder 3.0的安装教程了,就到微软的官网上下载去了,下载完成双击程序安装告诉我,要想安装Rep ...

  6. 如何在Report Builder中使用fnd_profile.value

    在EBS的Report开发中,需要根据客户化的一个Profile来控制用户可以访问的数据,可是在开发的过程中发现一直取不到该Profile的值,后来百度才找到了原因. 解决方法: 1.添加用户参数p_ ...

  7. Report Builder 打开报错

    提示:REP-0756:警告:找不到PL/SQL程序库’inv.pll’. 解决办法 处理:1.运行 ---输入REgedit ,在注册表内,查找注册表项Reports_path. 2.将下载的.pl ...

  8. [翻译]初识SQL Server 2005 Reporting Services Part 4

    原文:[翻译]初识SQL Server 2005 Reporting Services Part 4 这一篇是关于SQL Server 2005 Reporting Services四篇文章中最后一篇 ...

  9. Session for SSRS Report of Microsoft Dynamics AX

    Session for SSRS Report of Microsoft Dynamics AX 版权声明:本文为博主原创文章,未经博主允许不得转载. Contract •A data contrac ...

随机推荐

  1. 精妙SQL语句大全

    一.基础 1.说明:创建数据库 CREATE DATABASE database-name 2.说明:删除数据库 drop database dbname 3.说明:备份sql server --- ...

  2. 浅谈TCP通讯

    基于Tcp协议的Socket通讯类似于B/S架构,面向连接,但不同的是服务器端可以向客户端主动推送消息. 使用Tcp协议通讯需要具备以下几个条件: (1).建立一个套接字(Socket) (2).绑定 ...

  3. kubectl get componentstatus ERROR:HTTP probe failed with statuscode: 503

    通过kubectl命令可以查看k8s各组件的状态: [root@wecloud-test-k8s-1 ~]# kubectl get cs NAME STATUS MESSAGE ERROR cont ...

  4. 关于Tomcat控制台乱码解决办法___ 解决 IntelliJ IDEA Tomcat 控制台中文输出乱码问题

    Tomcat 控制台UTF-8乱码问题 1.修改cmd的编码格式 快捷键win+R打开运行程序,输入regedit打开注册表,找到以下路劲并且修改. [HKEY_LOCAL_MACHINE\SOFTW ...

  5. 关于Collections的操作方法

    Collections是一个包装类,其中包含有各种有关集合操作的静态多态方,比如可以作用在List和Set上,此类不能实例化. 排序 Integer[] array = new Integer[]{3 ...

  6. linux强制安装rpm包的命令

    rpm -ivh *********.rpm  --nodeps --force 强制安装会忽略掉所有依赖关系,强制进行安装

  7. LOJ#2015. 「SCOI2016」妖怪(凸包)

    传送门 首先可以把每个妖怪看成二维平面上的一个点,那么每一个环境\((a,b)\)就可以看成一条斜率\(k=-\frac{b}{a}\)的过该点的直线,战斗力就是这条直线在两坐标轴上的截距之和 对于每 ...

  8. 由一个场景分析Mysql的join原理

    背景 这几天同事写报表,sql语句如下 select * from `sail_marketing`.`mk_coupon_log` a left join `cp0`.`coupon` c on c ...

  9. python3+requests:post请求四种传送正文方式(详解)

    前言:post请求我在python接口自动化2-发送post请求详解(二)已经讲过一部分了,主要是发送一些较长的数据,还有就是数据比较安全等,可以参考Get,Post请求方式经典详解进行学习一下. 我 ...

  10. 编程大牛 Bruce Eckel 对新程序员的忠告

    简评:作者 Bruce Eckel 是编程界的大牛,著有大名鼎鼎的<Thinking in C++>和<Thinking in Java>.本文是他对程序员(尤其是新手)的忠告 ...