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

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.

主站蜘蛛池模板: 高淳县| 永济市| 白玉县| 双柏县| 虞城县| 梅河口市| 江北区| 南涧| 松江区| 九江县| 玉林市| 荣昌县| 丰宁| 靖江市| 宿州市| 宜兴市| 鄂托克旗| 威海市| 彰化县| 综艺| 阜新市| 黄冈市| 茶陵县| 尉氏县| 武川县| 滁州市| 靖宇县| 昌吉市| 淳化县| 城口县| 牡丹江市| 朝阳区| 广东省| 宁河县| 三穗县| 淳安县| 江源县| 仲巴县| 金湖县| 涪陵区| 探索|