List versus Table versus Matrix
So, let's have a closer look at the Tablix and investigate the difference between a List, a Table, and a Matrix.
The List is actually completely different from the Table and the Matrix. When you add a List to your report, you will see a List that contains a Rectangle. In the following image you can see this in the Document Outline:
In this example, I added a List from the Toolbox to the report body. Then I dragged and dropped three fields from the Report Data in the List, which I renamed as List_1
. Then, I dragged the captions from the Parameters on top of the List. Next, I spent some time aligning the textboxes in the list with the textboxes above the list.
You will probably find this a cumbersome way to create a simple list report, and it is. Any changes in the layout require you to realign the textboxes, which is time consuming. That is why a List data region is almost never used for these types of reports. We will use the List for other things. In Chapter 5, Document Reports we will see why we sometimes need the List.
The List can be used as a free form control if you need to position elements exactly, for example when they need to be printed on preformatted paper. Unless you have a really good reason to use a List, I would not recommend it.
Tip
Be careful
When moving textboxes around in a List with your mouse, it can happen that you move a textbox outside of the list, where you actually don't see it and it seems still in the list. That is why the Document Outline window is very interesting. In there you can see what is in the List and what is not. An alternative is to use the Parent
property. It will contain the name of the report item that is the parent of the one you selected.
Usually, we want to organize our database fields in rows and columns. To achieve that goal, the Table and Matrix are much better than the List.
In the previous chapter, when we created our first layout, there was an example on how we use a table to create a list. Also, when you use the wizard in Report Builder, it will use a Table in most cases to create the layout.
When you add a table from the toolbox on the layout, it contains two rows and three columns. By using the right mouse button you can add or remove columns and rows. There are three types of rows: Details, Header and Footer rows. The type of row that you right-click on to add a new one is the type of row that will be added. A table can contain multiple header, detail, and footer rows. This is especially useful when you want to show or hide a row dynamically. You will often add multiple rows to a table and then decide via an expression when they should be hidden or visible.
A table can contain detail data or aggregated data. Aggregating data means that you will create a group in the table, for example, by Item Number, and then calculate an aggregation of a detail value, for example the sum of the inventory by item.
Note
Detail data is the data that you see in the report dataset about this report feature. Grouped data is data that you will organize or group by a field or expression, that you define. The dataset always contains the information at the detail level. You add grouping, filtering, and sorting in the layout of the report to organize the information.
The main difference between a Table and a Matrix is that a table can contain one or more groups and a matrix has to contain at least one row and one column group. This means that a Matrix allows you to create a layout with a variable number of columns. Another difference is that, since in a Matrix data is always grouped, you don't have the detail level, as you do in a Table. If you want to see details when using a Matrix, I recommend including a drill-trough. You can do this with the textbox action properties. If you click on one of the textboxes in the Matrix and link it to a table or another report that contains the details, it would be similar to a flow field in Dynamics NAV.
Note
An example of how you can create links in reports is available in Chapter 6, Tips and Tricks, in the section, Creating links.
There are different types of groups and I will discuss them in the section about grouping in this chapter.