Reporting Services_PIOLEDB_Tutorial

  • 格式:doc
  • 大小:319.00 KB
  • 文档页数:9

Create Reports Utilizing SQL Server Reporting Services and PI OLEDBLearning Lab TutorialIntroduction (3)PI OLEDB (3)SQL Server 2005 Reporting Services (SSRS) (3)Installed Software on Tutorial PC (3)Basic Report Creation Tutorial (4)Step 1 – Opening the Tutorial Project (4)Step 2 – Report Definition File (4)Step 3 – Connection to PI Server via PI OLEDB (5)Step 4 – SQL Query (6)Step 5 – Layout and Preview (6)Step 6 – Deploying Reports to IIS (7)Reporting Models/Scenarios (8)Portal Integration (8)Embedded Reporting (8)Internet Reporting (9)Conclusion (9)IntroductionThe goal of this document is to learn how to create a simple report using the PI OLEDB provider in the MS SQL Server 2005 Reporting Services environment (SSRS).PI OLEDBOLEDB provider for OSIsoft‟s PI Server is the middle tier component that implements SQL for the PI Server.Other applications, capable of working with OLE DB data sources, can thus query the underlying PI data and provide it to end users in the …standardized form‟. One of these applications is the Microsoft‟s Reporting Services, which is part of the SQL Server 2005:SQL Server 2005 Reporting Services (SSRS)SQL Server 2005 Reporting Services is a server-based reporting platform that can be used to create and manage tabular, matrix, graphical, and free-form reports that contain data from relational and multidimensional data sources. The reports can be viewed and managed over a World Wide Web-based connection. Reporting Services includes the following core components:∙Complete set of tools that one can use to create, manage, and view reports∙Report Server (NT Service) component that hosts and processes reports in a variety of formats.These (output) formats include HTML, PDF, TIFF, Excel, CSV, and more.One of the sources of data the Reporting Services can work with are OLEDB providers. This document outlines a short tutorial describing how to create a simple report by means of the aforementioned components (SSRS and PI OLEDB). The goal is also to show the …simplicity‟ of this approach, because no programming is involved to createa report. In addition, the available report deployment models/schemas are shortly discussed at the end of thisdocument.Reporting Services detailed help can be found in MS SQL Server Books Online available at/sql/default.mspxInstalled Software on Tutorial PCWindows XP ProfessionalMicrosoft MDAC 2.7 SP1PI SDK 1.3.3.304PI OLEDB 3.1.0.0PI Server 3.4.370.54MS SQL Server 2005 with Reporting Services (can be on a separate PC)The following paragraphs describe how to create the SSRS report in the Microsoft Visual Studio 2005:Basic Report Creation TutorialThis tutorial will guide you through report project creation, set up connection information, define a query, adda table, and preview the report:Step 1 – Opening the Tutorial Project1.Click Start, point to Programs, point to Microsoft SQL Server 2005, and then click Business IntelligenceDevelopment Studio.2.On the File menu, point to New, and then click Project.3.In the Project Types list, click Business Intelligence Projects.4.In the Templates list, click Report Server Project.5.In Name, type Tutorial1.6.Click OK to create the project.The Tutorial1 solution is displayed in Solution Explorer.Step 2 – Report Definition File1.In Solution Explorer, right-click Reports, point to Add, and click New Item.2.In Add New Item, click Report.3.In Name, type Visited URLs.rdl and then click Add. A view opens that contains Data, Layout, and Previewtabs. This is the Report Designer component of Business Intelligence Development Studio. The report opens in Data view.Figure 1. Report Definition File in VS 2005Step 3 – Connection to PI Server via PI OLEDB1.In the Data tab, expand the contents of the Dataset drop-down list at the top of the page, and select NewDataset. The Data Source dialog box appears.2.In Name, type PI OLEDB.3.In Type, select OLE DB.4.Press the Edit button and fill in the PI OLEDB connection properties. See the PI OLEDB manual for details.5.In the Credentials tab explicitly specify login account (otherwise you may get errors when running the report).Figure 2. OLE DB Connection StringAfter the data source is defined, Report Designer creates a dataset (we named it PI OLEDB) and displays the generic query designer, which you can use to design the query. For this tutorial, we will create a query thatretrieves the times someone has visited the page.Step 4 – SQL Query1.Type the following or a similar query into the SQL pane of the generic query designer. The SQL pane is thetop pane in the design tool. In our example the tag 'pioledb001_string' contains IP addresses that representlogin times of a certain client PC. You may choose any other available tag and related query:SELECT time FROM picomp2 WHEREtime >'*-7d' AND tag LIKE 'pioledb001_string' ANDCAST(value AS string) = '192.168.100.5' GROUP BY time2.To view the results of the query, click the Run (!) button on the query designer toolbar.Step 5 – Layout and Preview1.Click the Layout tab and go through the dialogs that allow for specifying the format of your report. See SQLServer Books OnLine for more details.2.Save the report project. On the File menu, click Save All.3.Click the Preview tab. Report Designer runs the report and displays it in Preview view.Figure 3. Final Report in a Web BrowserStep 6 – Deploying Reports to IISThe final report has to be deployed onto the given location so that the IIS knows how to address it. A standard deployment model consists of a single report server instance that uses a local or remote SQL Server database engine to host the report server database. The following diagram shows the standard deployment model where the report server database is located on a remote server. The report database and the report server components can also be installed locally, so that the involved server components are on the same computer.Figure 4. Reporting Services StructureReporting Models/ScenariosUsers who work with business data often require the ability to create and refine reports on an ad-hoc basis.Reporting Services includes the Report Builder component to achieve this (more info about this area can be again located in SQL Server 2005 Books OnLine). There are a couple of other possibilities how users can access reports.At this place we will shortly summarize the various approaches:Portal IntegrationReports can be integrated into the web portal solution - MS SharePoint Portal Server. They can be …hosted‟in a portal page via a SharePoint web part:Figure 5. MS SharePoint Portal Server Reporting Web PartMoreover, in the portal environment it is possible to create a report that mimics a dashboard-style Web application by embedding multiple reports, charts, and data-driven images into a single free-form report layout.Embedded ReportingIn general, there are three options how to implement Reporting Services into the custom application: URL Access– direct and most efficient way to integrate the reports into the application.The report can be addressed directly via url; e.g.: http://myserver/reportserver/myreport.Report Server Web Service –provides additional capabilities of managing a content of the Report Server througha set of Web methods.ReportViewer controls for Visual Studio 2005 - In addition to URL access and the Report Server Web Service, Microsoft Visual Studio 2005 contains a set of freely distributable report viewer controls that make it easy to embed Reporting Services functionality into custom applications.Figure 6. Reporting Services Integration ScenariosInternet ReportingOne can make reports available outside the intranet by deploying a report server on an Internet-facing Web server. Such an Internet report deployment usually requires that a custom security extension to support forms-based authentication is in place.ConclusionAs outlined above, business users can use Report Manager, SharePoint Web parts, or a Web browser to view reports on demand, or subscribe to reports that are delivered through e-mail or to a file share. The number of possible scenarios is immense. In general we can say that whenever users need to incorporate tabular or chart data into a line-of-business application, it …pays off‟ to think about a reporting tool that keeps reports on a central server in a maintainable form. The SSRS environment is …one of the answers‟ to this problem. It is a very efficient tool that enables report creation without programming. To gether with PI OLEDB, the only “knowledge” that is needed is thus to know how to formulate the SQL query against the PI Server.。