Microsoft SQL Server 2000 Reporting Services Introduction (5)
[Abstract] This article mainly introduces how to integrate the REPORT Designer and modify the RDL file to quickly and flexible
The report 步 饬?? LT; / span> Matrix format and Toggle function
[Keyword] Reporting Services, .NET Framework, RDL file, Matrix format, Toggle function
n how to implement Matrix
The image above is an example provided in Reporting Services. Vertical to a company's product category and subcategory, lateral direction for years and quarter, this display mode can be used in many reports, such as general group companies will display out in portrait All molecular companies and departments. The following is an angle of the RDL file to analyze how this example is implemented. First, let's take a look at the query statement.
DatePart (YY, SalesOrdeerHeader.orderdate) as Orderyear, // Year
'Q' Datename (QQ, SalesOrdeerHeader.orderdate) as Orderqtr, // Quarter SUM (SalesOrderDetail.Unitprice * SalesOrderDetail.orderqty) AS Sales // Sales Data
From productSubcategory Inner Join
....................
WHERE (SalesOrderHeader.orderdate Between '1/1/2002' and '12 / 31/2003 ') // Time range
/ / The Group by GROUP BY guarantees the hierarchical relationship between data
GROUP BY
DatePart (YY, SalesOrdeerHeader.orderdate), Productsubcategory.Name, Productsubcategory.Name, 'Q' Datename (QQ,
SalesOrderHeader.orderdate), Productsubcategory.ProductSubcategoryId CommandText>
Let's take a look at how the RDL is hidden under the year.
Groupexpressions>
Grouping>
Visibility>
Similarly, the product category and product subcategory are also established, although this function can be easily implemented through the .NET development environment, but can save a lot of time if you can perform the RDL files. Let's take a look at how the report shows sales data.
Borderstyle>
Style>
Textbox>
Ok, analyze these key code, the whole company sales.rdl (can be found in the MS SQL Server installation directory) is very well understood, and many other codes are set in the format of the report. If you rewrite The format of this example is relatively pleasing, and you can put it out of the