Guide to tablix-step series for the report Service (4)

Source: Internet
Author: User

"Ah ha, I found you !" Your manager suddenly emerged from the flowers behind the table and shouted for victory. You looked at the manager in frustration.

"I have created a basic report and captured some data. I am planning to-" You explained quickly before he interrupts you.

"It's good to finish it. Big Boss needs this report. The sooner the better," your manager said after leaving these words.

You sat down heavily, opened sqlservercentral.com, and went to the reader series.ArticleIt's time. This article describes how to group information, adjust dynamic columns and row groups, and use tablix in reporting service.

 

Table + matrix + list = tablix

Tablix is a tool used by SSRs to display data. SQL Server Reporting Services 2008 and later. It consists of three similar report items: tables, matrices, and lists. The tablix view is 4-1.

Figure 4-1.tablix View

 

You cannot find the tablix tool in the toolbox of business intelligence development studio (bids. Instead, you can view the table, matrix, and list items in Figure 2. No matter which of the three items you drag into the report, the report service actually uses tablix.

Figure 4-2. tablix template displayed in the toolbox

Note: if you cannot see the toolbox in bids, click View> toolbox option or press the shortcut key CTRL + ALT + X. in the toolbox, all report items are placed under the "report items" header.

Next we will look at the first tablix template: Table

 

Table

A table is a simple object that can display grouped and aggregated data. If the columns in the data are fixed, you can use the table items. Let's drag the "table" to the report. In the previous chapter, we have set a dataset. Here we use this dataset directly for the table. Each table can only capture data from one data set. You can select a dataset from the drop-down list of the datasetname attribute in the properties pane. Attribute pane 4-3.

Figure 4-3. Attribute pane and datasetname attribute

 

Now we can use fields in the dataset to involve tables. We can insert fields in the table in the following ways:

    • Import fields from the report data pane
    • Select a field from the drop-down list in the upper right corner of each grid, as shown in Figure 4-4.
    • Select in the attribute pane of each grid

Figure 4-4. Table field selection

 

Setting fields in that way is not important. The layout of a simple table is 4-5.

Figure 4-5. Simple table layout

 

Group

Tablix displays tables through each "details" group. The "details" group provides a basic concept for us to understand the principles of grouping. Each time the report service sees a unique row, it creates a detailed information group. Similar to this principle, each created group creates a detailed information group for the unique value. Next we will illustrate this concept through instances.

In the group pane. In versions earlier than ssrs2008, you can see this pane in the attribute pane of tables and matrices. In later versions, you can see this pane at the bottom of bids, see Figure 4-6.

Figure 4-6. Grouping window for rows and columns

 

Because we work on the table template, let's create a row group. Click the drop-down arrow next to the details in the row group pane. Multiple options are displayed, including "add group ". Select Add group> parent group, and then select the condition column of the group. If you want to add the group header and the group end, select the corresponding checkbox. completed 4-7.

Figure 4-7. Completed tablix group window

 

After you click Finish, You can see 4-8 on the table design page.

Figure 4-8. Table Design After grouping

 

You can add an aggregate function to the group header or tail, or enter a title to describe this column. Next we will use an expression to create a cumulative aggregation. Right-click the cell at the bottom right corner of the table at the end of the row and column, right-click the text cell attribute, and enter = sum (Fields! Totaldue. value), as shown in 4-9.

Figure 4-9 text box attributes

 

Before running the report, let's take a look at the tablix matrix template. Before discussing the matrix, we first discuss grouping because it is the key point before understanding the differences between tables and matrices. Next let's look at the matrix.

 

Matrix)

Like a table, a matrix can also aggregate and group rows or columns. The Group result increases on the X axis and the axis. The method for creating a column group is similar to that for a row group. The only difference is to set a row group pane and a row group pane. The following example shows a summary of the sales reports by month and region using a matrix. As shown in Figure 4-10.

Figure 4-10. Matrix Layout

 

List)

The list is often forgotten when discussing tablix because it is too simple. Each row in the dataset generates one row and one column in the list. If you need to create an element not limited to the current format in the report, you can use the list. You can enter any text box in the list to make the layout desired by the end user.

 

Formatting)

The end users of a report usually want the data to be displayed in the specified format. Because the smallest unit used by the format is the text box. Therefore, you can apply the format to tablix by setting tables, matrices, and lists. In the Table-based reports we have created, we have made some changes to the column sorting rules and font attributes.

 

Column sorting

Almost every report needs to be sorted by columns to display the data in a given order. Click any one of tablix, right-click in the displayed gray box, and select the tablix attribute, as shown in Figure 4-11.

Figure 4-11. Select the tablix attribute window

 

In the Properties window, select sort from the options on the left. Select the column you want to sort by rule and select the sort order as A-Z, that is, ascending. The completed window is 4-12. Remember that the Group itself is also sorted. If you find a sorting problem after running the report, check to ensure that the sorting of other types does not overwrite the current sorting.

Figure 4-12. Sorting Pane after completion

 

Font attributes

Next, let's look at the font attributes. This setting can make the font look better. Select the header row of all columns. In the properties pane, select font attributes> fontweight attributes> bold options, as shown in Figure 4-13.

Figure 4-13. Font attribute selection in the properties pane

 

After all these preparations, grouping and format settings are complete, we welcome the completed reports. Click the preview tab and you will see the preview tab 4-14.

Figure 4-14. Final report View

 

Next: Dessert

Now, we have learned some core concepts of reports in the report service. We display data in tables and matrices, group, sort, and set the format. This allows our reports to meet the needs of most users. Because we always want to provide users with the best products, next we will learn how to add charts and maps to reports to make the reports for Big Boss look dynamic. In the next article in this series, I will describe how to display unknown charts in charts.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.