Tài liệu Sams Microsoft SQL Server 2008- P7 ppt

50 835 0
Tài liệu Sams Microsoft SQL Server 2008- P7 ppt

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

ptg 281 Paging Report (Improved in 2008) 15 columns that you want to have and spacing between. Figure 15.3 shows a multicolumn report design example. Advanced Group Properties: RepeatOnNewPage, KeepTogether (New in 2008), KeepWithGroup (New in 2008), and HideIfNoRows (New in 2008) These properties are accessible in the Advanced mode of the grouping pane and enable you to do the following: . RepeatOnNewPage: Repeat the group’s row header on every page where the group has at least one row. . KeepTogether: Force SSRS to attempt keeping the entire group together on a page, instead of inserting a page break between. Not supported for column groups. . KeepWithGroup: Help to keep the group’s header and footer together on the same page, instead of orphaning to another page. The property can have one of the following values: . Before: Keep this static member (mostly footer) with the previous group in a grouping pane. Note gray static members in the grouping pane. . After: Keep this static member (mostly header) with the previous group in a grouping pane. FIGURE 15.3 Multicolumn report design. From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 282 CHAPTER 15 Advanced Report Formatting . None: Let SSRS decide whether to use Before or After . . HideIfNoRows: Hide a static element of a group when the group has no data. This property overrides other Visibility properties. To access the Advanced mode, display the grouping pane (if not shown, in BIDS select Report, Grouping), and using the arrow on the right side of the grouping pane select Advanced Mode, and then select Tablix where you want to set those properties. Summary SSRS supports a comprehensive set of formatting capabilities through the report item’s properties, which control output appearance. Some of the key properties are as follows: . BackgroundColor: Controls the background color of the item. When a report requires alternating colors for rows of output, this property can be used in conjunc- tion with functions RowNumber() and RunningValue . . Color: Controls the color of the text. . Format: .NET Framework formatting string to apply to the item. The following are examples of format strings: . ###.## formats a value of 012.30 to the output 12.3 . . (###)###-#### formats a value of 1234567890 to the output (123)456-7890 , which is typical presentation of a phone number. . C formats a value of 1234.56 to a typical presentation of currency $1,234.56 . . yyyy-MM-dd HH:mm formats 11:59PM on 1/2/2006 to 2003-01-02 23:59 . . Language: Controls locale formatting. For example, when set to English (United Kingdom) , the currency sign in formatting changes from $ to £ . . PageBreak, KeepTogether, and KeepWithGroup: Control pagination before and after an item. . PageHeight and PageWidth: Control physical page sizing for PDF- and Image- rendering extensions. . RepeatOnNewPage and HideIfNoRows: Control the behavior of a group’s header (footer) and visibility of a group when it has no rows. . InteractiveHeight and InteractiveWidth: Control logical page sizing by the HTML-, Word-, and Excel-rendering extensions. The following chapter discusses functionality that SSRS provides to simplify navigation in large reports and within the hierarchy of reports. From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg CHAPTER 16 Report Navigation IN THIS CHAPTER . Hyperlink (Go to URL) Navigation . BookmarkLink (Go to Bookmark) Navigation . Drillthrough (Go to Report) Navigation . Document Map . Hide and Toggle Items . Practical Application of Action Items O ne of the main uses for navigation functionality is to simplify navigation of large reports and navigation of report hierarchies. To achieve this, report developers can add hyperlink actions (or simply actions) to a report. Reporting Services supports three types of actions: . Drillthrough (Go to Report): Go to other reports. This action also provides an opportunity to provide parameters for the target report and the ability to jump to the same report with different parameters. This action is denoted with the <Drillthrough> element in a report’s Report Definition Language (RDL). . BookmarkLink (Go to Bookmark): Jump to other areas (bookmarked) within the report. This action is denoted with the <BookmarkLink> element in a report’s RDL. . Hyperlink (Go to URL): Jump to web pages and other HREF constructs, such as mail and news. This action is denoted with the <Hyperlink> element in a report’s RDL. Expressions can be used as a value for any action. Report developers can add an action from either the Item Properties (for example, Text Box Properties for a text box) dialog box or from the Properties window. To open the Properties dialog, right-click a report item, select <Item Name> Properties from the shortcut menu, and then click the Action tab and select one of the actions: Go to Report, Go to Bookmark, or Go to URL. From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 284 CHAPTER 16 Report Navigation FIGURE 16.1 Action tab. Alternatively, you can modify the Action property from Properties window by just clicking the ellipsis to the right of the Action property (see Figure 16.1). You can add actions to a Textbox, Image, Gauge, or Chart data series. Because a Tablix can contain a Textbox, Image, Gauge, or Chart, those, in turn, can provide actionable items within a Tablix. Any Reporting Services item can have Bookmark and Document Map labels associated with it. Those labels assist in navigation by providing “landing marks” for navigation destinations. To illustrate this, imagine that you have a bookmark Bookmark10 located on page 10 of your report and a table of contents (TOC) on page one of your report. One of the TOC’s lines contains the BookmarkLink action involving Bookmark10. If you click this action in the TOC, the focus of the view will switch to page 10. You can set Bookmark and Document Map via like-named properties in the Properties window. TIP Highlight an actionable item so that it is intuitive to a user that the item can be clicked. Blue in color, underlined text items usually provide good highlights. Hyperlink (Go to URL) Navigation When a report developer adds the Hyperlink action, SSRS generates HREF to create a navi- gable HTML link. For example, when you enter http://www.microsoft.com into a Go to URL text box and set the value of Textbox.Value equal to Visit Microsoft , the following is the link generated by SSRS when it renders the report to HTML format: From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 285 BookmarkLink (Go to Bookmark) Navigation 16 <a href=”http://www.microsoft.com/” style=”text-decoration:none;color:Black” TARGET=”_top”>Visit Microsft</a> Reporting Services allows navigation using other constructs valid for the HREF tag. For example, javascript:history.back() enables you to emulate a browser’s Back button. This particular construct relies on Java support by the browser (Netscape 2 or later and Internet Explorer 3 or later) and enabled JavaScript. Other valid constructs are . mailto:support@adventureworks.com , which allows creating a link that launches an email editor and places support@adventureworks.com on the To line . ftp://www.microsoft.com to launch an FTP download . news:www.microsoft.com to get to a newsreader NOTE Not all HREF constructs function in Preview mode. For example, javascript:history.back() will not deliver the action in Preview mode; also, this construct will function after the report is deployed to a Report Server. To create a Hyperlink (Go to URL) action, enter a valid (such as http://www.microsoft.com or other described previously) HREF construct in the Go to URL action field. Figure 16.1 shows the Action property page that allows you to input the Go to URL action. Action has the following corresponding RDL: <Action> <Hyperlink>http://www.microsoft.com</Hyperlink> </Action> Or <Action> <Hyperlink>={Expression}</Hyperlink> </Action> In the preceding code fragment, an {Expression} is any expression that evaluates to a valid HREF construct as described previously, such as http://www.microsoft.com. BookmarkLink (Go to Bookmark) Navigation BookmarkLink (Go to Bookmark) simplifies navigation for large reports. This action allows navigation to a bookmarked line or page of the report. Keep in mind that you can associ- ate multiple actions with a single bookmark link. From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 286 To create a BookmarkLink navigation, the first step is to set a bookmark. A bookmark can be set for any report item using the following: . Properties window: The Properties window is normally docked in the lower-right corner of Report Designer. If you do not see this window, press F4 or choose Properties Window from the View menu. . Navigation tab of an item’s Properties dialog box: The Properties dialog box can be accessed by right-clicking a report item and selecting Item Properties from the shortcut menu, where Item is the name of an item, such as Text Box. The Action tab of an item’s Properties dialog box is shown in Figure 16.1. After Bookmark is set, Report Designer adds the following RDL: <Bookmark> ={Expression} </Bookmark> The next step is to create a BookmarkLink action, which performs the navigation to the bookmark set in the previous step. The BookmarkLink action can be created for Textbox, Image, Gauge, and Chart data series. To create a BookmarkLink action, open the Action tab of an item’s Properties dialog box, select Go to Bookmark, and enter a bookmark’s expression. After the BookmarkLink action is set, Report Designer adds the following RDL: <Action> <BookmarkLink> ={Expression} </BookmarkLink> </Action> Drillthrough (Go to Report) Navigation This type of action is commonly used when there is a need to have master (parent) and detail (child) reports. An action, which takes users to a detail report, is created on the master report. To create a Drillthrough navigation (action), you need to set the Go to Report expression on the Action tab of the item’s Properties dialog box. The Go to Report expression must evaluate to a name of a report. You can also specify parameters to pass to a report by clicking the Add button under the Use This Parameters to Run the Report section (which becomes visible once you select Go CHAPTER 16 Report Navigation From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 287 Document Map 16 to Report action on the Action tab). In the Parameters dialog box, you can enter a constant name of a parameter and an expression that will assign a value to the parameter. The following is an example of the RDL for the Drillthrough action: <Action> <Drillthrough> <ReportName>Product Detail</ReportName> <Parameters> <Parameter Name=”ProductNumber”> <Value>=Fields!Name.Value</Value> </Parameter> </Parameters> </Drillthrough> </Action> NOTE The Back to Parent Report button on the Report Viewer’s toolbar provides a convenient way to navigate back to a parent. This button is especially handy in Preview mode when a Back browser button is not available. Document Map Much like bookmarks, the document map is designed to simplify navigation for large reports. A document map is intended for interactive (HTML rendering) report viewing and is displayed as a side panel on a report. PDF, Word, and Excel rendering extensions have a different way of articulating a docu- ment map. Excel rendering extension creates a separate worksheet with the name Document Map, which provides links to a worksheet with the report’s data. PDF displays the document map in the Bookmarks navigation tab. Document map labels are set similarly to bookmarks as they relate to report items. To create a document map for a report, you would fill the DocumentMapLabel property in the Properties window for each report item them that you would like to include on the map. When a report has at least one document map label, Reporting Services automatically generates a document map and renders a treelike structure containing navigational items. SSRS builds a document map entry when it sees the following RDL: <Label>={Expression}</Label> Document map labels from report items are displayed on the same level (next after the root level) and ordered in the order of the report item’s appearance on a report. The order is based first on the position of the top side (vertical ordering) of a report item and then on the position of the left side (horizontal ordering) of the report item. From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 288 The document map also supports a hierarchical display of labels. SSRS creates a hierarchi- cal view on a document map when you set Document Map and Recursive Parent expres- sions using the Advanced tab of the Group Properties dialog box. PDF shows labels of a document map in the Bookmarks navigation panel. (In Adobe Reader 9.0, the panel is accessible from View, Navigation Panels, Bookmarks menu.) Note that early versions of the Adobe Reader did not support hierarchical bookmarks. The document map has the same name as the name of the report. This name is used for the root node of a document map. There are no options that allow changing the name of a document map and only one document map is allowed per report. Rendering of a document map by the Word rendering extension is a bit trickier and you have to perform a couple of additional steps. The steps are necessary because the Word rendering extension renders the document map as table entry fields. You can see table entry fields as {TC “Text” [switches]} if you show hidden fields (you can do this by using Ctrl-* shortcut) while viewing a Word document. To create a table of contents (TOC) from table entry fields, you would perform an “insert table of contents” action and set appropriate options. In Word 2007, you select the References tab on the Ribbon, click the Table of Contents button, and select Insert Table of Contents from the drop-down list. At this point, a Table of Contents dialog opens. Click the Options button, and in the Table of Contents Options dialog box unselect everything except the Table Entry Fields check box. Click OK until the TOC is inserted into the exported document. Hide and Toggle Items Hiding and toggling functionality supports interactive visibility for sections of a report and enables you to dynamically expand portions (of a report) that you want to see. This is yet another option to simplify navigation. Hide and toggle functionality can be used, for example, to implement master/detail functionality, category/subcategory functionality, or to simply shorten a large report. To implement this functionality, you would leverage several properties: . InitialToggleState: The InitialToggleState property indicates an image that is displayed for a toggle item: collapsed, expanded, or expression. Normally, the toggle control is a plus or minus symbol, which indicates an expanded or collapsed state, respectively. The InitialToggleState property only defines a picture of a state image, but does not change the visibility of an item. If not specified, the default toggle state is False (or collapsed). If a report developer clears the InitialToggleState property, the state reverts back to False . . ToggleItem: A name of report item that will show or hide this report item. . Hidden: Indicates an initial visibility of a report item. NOTE Note that the toggle state is not available for groups. It is available only for individual items. CHAPTER 16 Report Navigation From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 289 Practical Application of Action Items 16 BIDS adds the following RDL for the InitialToggleState : <ToggleImage> <InitialState>true</InitialState> </ToggleImage> Reporting Services adds the following RDL for ToggleItem and Hidden . (When the item is visible, the <Hidden> tag is not included.) <Visibility> <ToggleItem>{ToggleItem}</ToggleItem> <Hidden>={Expression}or {true}</Hidden> </Visibility> Practical Application of Action Items For illustrative purposes, imagine that the Adventure Works Internet sales department wants to create an interactive product catalog. The initial screen of a report should not be larger than a single page. A report must provide effective navigation through the products (items in the catalog). A user of the catalog must be able to navigate through the product category and subcategory hierarchies. Implementation First, using any method described in earlier chapters, let’s create a new report (Navigation) and a data set (you can name the data set ProductCategories ) with the following query using the AdventureWorks data source: SELECT Production.ProductCategory.Name AS CategoryName, Production.ProductSubcategory.Name AS SubCategoryName, Production.Product.Name AS ProductName, Production.ProductPhoto.ThumbNailPhoto, Production.Product.ProductNumber FROM Production.ProductCategory INNER JOIN Production.ProductSubcategory ON Production.ProductCategory.ProductCategoryID = Production.ProductSubcategory.ProductCategoryID INNER JOIN Production.Product ON Production.ProductSubcategory. ProductSubcategoryID = Production.Product.ProductSubcategoryID INNER JOIN Production.ProductProductPhoto ON Production.Product.ProductID = Production.ProductProductPhoto.ProductID INNER JOIN Production.ProductPhoto ON Production.ProductProductPhoto.ProductPhotoID = Production.ProductPhoto.ProductPhotoID From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. ptg 290 Text box Table with 3 row groups, including Details group Row groups Matrix with single column group based on CategoryName FIGURE 16.2 Navigation report Design view. Create a report layout outline, as shown in Figure 16.2. This report uses Matrix (remember that Matrix is a template for Tablix) to provide category navigation. CHAPTER 16 Report Navigation To show pictures from the database, add an Image report item from the toolbox to the last column of the Details row in the table. To show pictures from a database, right-click the cell with an image in it and select Image Properties from the context menu. Set Select the Image Source to Database. Set Use This Field to [ThumbNailPhoto] and set Use This MIME Type to image/jpeg. Right-click the Matrix’s cell with CategoryName value in it and select Text Box Properties from the context menu. On the Action tab (see Figure 16.3), select Go to Bookmark and select [CategoryName] from the drop-down list. This adds the following expression to the Select Bookmark action: =Fields!CategoryName.Value This bookmark will allow users to access an appropriate category name on a report. Apply formatting so that a user can tell that this is a clickable item. For example, in the Text Box Properties dialog box (under the Font tab), select Italic, Blue, Underline font. From the Library of STEPHEN EISEMAN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... Welcome screen 3 On the Select How to Define the Connection screen, click the New button Enter the requested information To connect to SQL Server database, select Native OLE DB \SQL Native Client as the provider 4 Enter the server name (for the local server, you can use either server name, localhost or [dot]) Select the authentication (Windows authentication is preferred.) Select or enter AdventureWorksDW... feature that first appeared in SQL Server 2005 UDM greatly simplifies access to data and combines the best of relational and analytical models UDM allows Reporting Services to get data from Analysis Services in a similar fashion as from any relational data source One way to think about UDM is as a view on data, which allows “combining” data from various data sources (SQL Server relational and OLAP databases,... familiar Structured Query Language (SQL) syntax typically used with relational databases, but it is not an extension of SQL Data Mining Extensions (DMX) is a language that you can use to create and work with DMMs in SSAS You can use DMX to create new DMMs, to train these models, and to browse, manage, and predict using those models The DMX language is an extension of SQL, to create and work with models... CustomerKey, BikeBuyer, Age) OPENQUERY ( [Adventure Works DW], ‘SELECT CustomerKey, BikeBuyer, Age FROM vTargetMail’) NOTE The first parameter for OPENQUERY is a named data source that exists on the Microsoft SQL Server 2005 Analysis Services (SSAS) database, such as [Adventure Works DW] used in this example 17 DMM does not, usually, store inserted data; instead, it builds a statistical model (statistical... complexity of either query is fairly comparable The key difference is in the underlying structures that each query accesses At this point, you should not be concerned if you are not familiar with MDX SQL Server 2008 has an extremely capable visual designer that makes creation of an MDX query a fairly easy endeavor The result of both queries is the same and is shown in Table 17.1 (OLAP) Please purchase... creating a new model, you should do the following: Define the problem What columns or attributes should the model predict? Determine the location of the data to be analyzed The source of data could be a SQL Server database or a cube Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark From the Library of STEPHEN EISEMAN Data-Mining Concepts 299 Decide the data-mining algorithm the... by HTML, Excel, Word, and PDF rendering extensions The next chapter explains how SSRS works with multidimensional data sources and how it integrates with Analysis Services and data-mining features of SQL Server 2008 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark From the Library of STEPHEN EISEMAN CHAPTER 17 Working with Multidimensional Data Sources IN THIS CHAPTER Analysis... combine data, but rather creates a metadata (data describing) view This does not affect the source data itself, but allows creating a metadata view that, for example, may have a “relationship” between SQL Server and an Oracle table Then UDM can be queried, like a database, and UDM, in turn, will access original data sources to retrieve needed data UDM blurs the usual differentiation between OLTP and DW... queries relational data for each Multidimensional Expressions (MDX) query; and Hybrid OLAP (HOLAP a combination of MOLAP and ROLAP) Details of vari, ous modes are beyond this book’s scope A Transact -SQL (T -SQL) query against the AdventureWorks DW database to get a summary by country would look like the following: SELECT DimSalesTerritory.SalesTerritoryCountry AS [Country-Region], SUM(FactInternetSales.SalesAmount)... This is a basic cube that will help you to understand how to use Reporting Services with Analysis Services You can find more information about cubes and advanced features of Analysis Services in the SQL Server Books Online KPIs are designed to evaluate performance criteria that a business, usually, considers strategic in nature Performance is evaluated against a specified goal and has to be quantifiable . first parameter for OPENQUERY is a named data source that exists on the Microsoft SQL Server 2005 Analysis Services (SSAS) database, such as [Adventure Works. support@adventureworks.com on the To line . ftp://www .microsoft. com to launch an FTP download . news:www .microsoft. com to get to a newsreader NOTE Not all

Ngày đăng: 14/12/2013, 16:15

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan