官术网_书友最值得收藏!

Aggregation in reports

Totals are an obvious need in most of the reports. SSRS brings in easy and powerful aggregation capabilities. This recipe will discuss a couple of aggregation methods and how they can be applied at different levels.

How to do it…

Reports can be aggregated as follows:

  1. In this recipe, two aggregations will be implemented:
  2. Total value of transactions per customer.
  3. Count of the total number of transactions per customer.
  4. To define the total value of the transaction, navigate to the Data | AmountMst node.
  5. Set the Aggregation Function property to Sum.
  6. To display the count of records implement the following steps. Go to the Groupings | AccountNum node in the table data region.
  7. Right-click on Add and select Field.
  8. Set the following properties:
  9. Preview the report and notice that the aggregated values appear with the customer details. The transactions column indicate the number of records, while the other is the total value of the transactions.

How it works…

Aggregation provides the ability to calculate data based on various functions such as Count, Sum, Avg, Min, and Max. These are applicable to a data region or a dataset. The results of the aggregation can be displayed based on the data region.

When a certain field is to be displayed aggregated in the entire report, then aggregation can be configured in the property of the field in the dataset. Each field has a property called Aggregate Function, which must be configured in this case. If the aggregation is only for the specific data region, then it must be defined in the report control in the data region.

Aggregate function results can be displayed as a summary in the header/footer for the table and list data regions. While in the matrix report, the columns and rows can be aggregated to display a grand total.

主站蜘蛛池模板: 阳高县| 冕宁县| 姜堰市| 四平市| 临夏市| 德州市| 佛教| 莱州市| 石阡县| 达尔| 贺兰县| 孟州市| 肃北| 郯城县| 石泉县| 丰镇市| 惠州市| 武汉市| 兴山县| 定结县| 德庆县| 静宁县| 郎溪县| 合川市| 乌鲁木齐县| 广丰县| 桦川县| 嘉义市| 马尔康县| 绥德县| 湘潭县| 邛崃市| 巴南区| 玉龙| 海门市| 渭南市| 响水县| 鄄城县| 石家庄市| 简阳市| 九龙坡区|