tailieunhanh - Hướng dẫn học Microsoft SQL Server 2008 part 159
Thêm các trường tính vào dữ liệuMột khi dữ liệu được định nghĩa, nó có thể thêm các trường để nó và chỉ định một biểu thức cho giá trị trường. Ví dụ, bạn có thể thêm một trường để các sản phẩm dữ liệu có tên là''lề'', và thiết lập các biểu thức để tính toán nó như ListPrice - StandardCost. Để thêm một trường, hãy làm theo các bước sau: | PartX Business Intelligence FIGURE 73-6 Example of multi-value nested parameters Adding calculated fields to a dataset Once the dataset is defined it is possible to add fields to it and specify an expression for the field value. For example you could add a field to the Products dataset named Margin and set the expression to calculate it as ListPrice - StandardCost. To add a field follow these steps 1. Right-click on the Products dataset and choose Add Calculated Field. The Dataset Properties dialog displays showing a blank row on the Fields tag. 2. Enter Margin for the new Field Name. 3. Enter the following expression as the Field Source. Alternately click the fx button to launch the expression editor and build the expression using the fields listed there. Fields - Fields 4. Select OK and the new field is added to the dataset. Best Practice While it is possible to achieve the same result by including the calculation in the SQL statement this approach is very convenient when calling a stored procedure that you don t want to include the calculation in or that you don t have permission to update. However the report expression language requires careful coding to handle any NULL values or data type conversions. It is also possible to include expressions in the report layout but this may require writing and maintaining the expression multiple times within the report. Adding the calculated field to the dataset ensures that the expression is defined in one place and simplifies report construction and maintenance. Working with XML data sources XML can be a very useful data source for reports. Individual files can provide easy-to-deploy datasets that are not otherwise available. Web Service access allows reports to be enhanced by services available inside and outside the organization. The example in this section demonstrates both types of data 1542 Authoring Reports with Reporting Services 73 sources using an XML file .
đang nạp các trang xem trước