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

Creating sections

Users want to see the details of orders. They would like to see the order number and then a small table showing the details (product name, promotion, quantity, and unit sell price) within each order.

Getting ready

Create a simple list report with Sales order / Order number, Products / Product, Sales fact / Quantity, and Sales fact / Unit sale price as columns.

How to do it...

Creating sections in a report is helpful to show a data item as the heading of a section. When you run the report, separate sections appear for each value. There is a way to reconstruct the report, and this is how to do it:

  1. Click on the Order number column. Hit the Section button on the toolbar as shown in the following screenshot:
  2. You will see that Report Studio automatically creates a header for Order number and moves it out of the list.
  3. Notice that the Order number field is now grouped as shown in the following screenshot:
  4. Run the report to test it.

How it works...

The information we are trying to show in this report can also be achieved by normal grouping on order number. That will bring all the related records together. We can also set an appropriate group/level span and sorting for better appearance.

However, in this recipe, I want to introduce another feature of Report Studio called section.

When you create a section on a column, Report Studio automatically does the following:

  • It creates a new list object and moves the current report object (in our case, the existing list) inside that. This is report nesting. Both the inner and outer objects use the same query.
  • It creates grouping on the column selected for section, which is Order number in this case. It also creates a group header for that item and removes it from the inner list.
  • It formats the outer list appropriately. For example, hiding the column title.

There's more...

Some of the advantages of creating sections are as follows:

  1. As mentioned earlier, Report Studio does a lot of the work for you and gives you a report that looks more presentable. It makes the information more readable by clearly differentiating different entities; in our case, different orders. You will see mini-lists or tables, one for each Order number, as shown in the following screenshot:
  2. As the outer and inner queries are the same, there is no maintenance overhead.

See also

  • The Creating a nested report – defining the master-detail relationship recipe in Chapter 2, Advanced Report Authoring
主站蜘蛛池模板: 平谷区| 太康县| 黄龙县| 云南省| 辽源市| 儋州市| 萨迦县| 定襄县| 长沙县| 罗江县| 玉树县| 车致| 苗栗市| 黑龙江省| 呼图壁县| 虎林市| 新化县| 宁陵县| 饶平县| 来宾市| 廉江市| 石门县| 绥芬河市| 神木县| 邵东县| 林西县| 高清| 利川市| 宁河县| 东兴市| 辽阳市| 泰州市| 彭州市| 隆子县| 砀山县| 孟村| 鄢陵县| 临洮县| 南康市| 新竹县| 龙井市|