Microsoft SQL Server 2005 Express Edition for Dummies phần 8 pps

42 390 0
Microsoft SQL Server 2005 Express Edition for Dummies phần 8 pps

Đ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

Creating your report Now that you’re an expert on all of the moving parts found in SQL Server’s reporting architecture, it’s time to start putting them to work for you. To begin, I call out those important but somewhat tedious tasks that you need to take care of before you can get to the fun stuff: 1. Make sure that your computer has the complete reporting support infrastructure. This runs the gamut from enough processor horsepower, memory, and bandwidth to software components. For example, if you grant remote users access to report content via a browser, you need to ensure that your computer has a working Web server. 2. Make sure you download and install all the correct database components. Simply downloading SQL Server 2005 Express with Advanced Services isn’t enough; you also should obtain a copy of SQL Express Toolkit, available for free from Microsoft. Found among its technologies are SQL Server Management Studio Express as well as SQL Server Business Intelligence Development Studio, which contains the Report Designer. You can get the toolkit from the Microsoft Web site. 3. Configure your report server. You need to perform or verify a number of administrative tasks before you’re ready to start building reports. You can address all these from Reporting Services Configuration Manager. For example, to successfully publish reports, you must set up at least one virtual directory on the server. As you can see in Figure 18-6, I created a virtual directory to serve as a destination for my reports. 4. Make sure your database is created and populated. For the example reports that I show you, the following two tables are all that’s needed: CREATE TABLE Clients ( ClientID INT PRIMARY KEY NOT NULL, CompanyName VARCHAR(50) NOT NULL, RegionCode CHAR(1) NOT NULL ) CREATE TABLE Transactions ( TransactionID INT PRIMARY KEY NOT NULL, ClientID INT NOT NULL REFERENCES Clients, TransactionDate DATETIME NOT NULL, TransactionAmount DECIMAL(5,2) NOT NULL ) 278 Part V: Putting the Tools to Work: Programming with SQL Server 2005 Express 26_599275 ch18.qxp 6/1/06 8:48 PM Page 278 With these introductory administrative tasks out of the way, now you’re ready to create some reports. Just follow these steps: 1. Launch Report Designer. Report Designer is found within SQL Server Business Intelligence Studio. It starts up Visual Studio, which is Microsoft’s flagship software develop- ment platform. 2. Create a new project by choosing File➪New Project. The New Project dialog box opens, as shown in Figure 18-7. In this exam- ple, I’m using the Report Server Project Wizard, which is a very handy tool for quickly designing, developing, and deploying a report. 3. Create a new data source or use an existing one. You can click the Edit button on the Report Wizard dialog box to enter the details of your database connection. After completing this task, you can then test things out, which is what’s happening in Figure 18-8. Figure 18-6: Creating a virtual directory in the Reporting Services Configura- tion Manager. 279 Chapter 18: Full-Text Searching and Reporting Services 26_599275 ch18.qxp 6/1/06 8:48 PM Page 279 4. Develop your query. This logic is the foundation of your report. Luckily, the Report Server Project Wizard includes a tool to help quickly generate your query. You launch this tool by clicking the Query Builder button, which you now see in the Report Wizard dialog box. Figure 18-8: Testing a database connection. Figure 18-7: The New Project dialog box. 280 Part V: Putting the Tools to Work: Programming with SQL Server 2005 Express 26_599275 ch18.qxp 6/1/06 8:48 PM Page 280 5. With the Query Builder launched, either directly write your query or use the Generic Query Designer tool for help. Click the upper leftmost button to launch this tool. You can use this tool to graphically develop your query, which is what’s happening in Figure 18-9. 6. Pick the report type you want to generate. Your choices are tabular or matrix. 7. Choose the layout for your report. Figure 18-10 shows how this example report appears. 8. Continue customizing the look and feel of your report. The wizard includes several dialog boxes specifically designed for this purpose. 9. Decide how (and where) you want your report published. Your options here are directly determined by what you did during Step 3 of the previous steps. Figure 18-11 shows that I’m deploying this report to the virtual directory I created earlier. Figure 18-9: The report’s query, as generated by the Generic Query Designer. 281 Chapter 18: Full-Text Searching and Reporting Services 26_599275 ch18.qxp 6/1/06 8:48 PM Page 281 10. Verify your selections and click Finish to generate your new report. Figure 18-12 shows where you verify your settings, and 18-13 shows the final output. Figure 18-11: Choose where you want to publish your report. Figure 18-10: The layout for the new report. 282 Part V: Putting the Tools to Work: Programming with SQL Server 2005 Express 26_599275 ch18.qxp 6/1/06 8:48 PM Page 282 Figure 18-13: The new report as seen from within SQL Server Business Intelligence Studio. Figure 18-12: The settings for the new report. 283 Chapter 18: Full-Text Searching and Reporting Services 26_599275 ch18.qxp 6/1/06 8:48 PM Page 283 You can customize, preview, and even debug your report from within SQL Server Business Intelligence Studio. In fact, you can even edit the XML-based report definition language (RDL) file that’s generated as part of this process. Here’s a small snippet from the file, which shows por- tions of both the data connection and formatting logic: <?xml version=”1.0” encoding=”utf-8”?> <Report xmlns=”http://schemas.microsoft.com/sqlserver/reporting/2005/01/ reportdefinition” xmlns:rd=”http://schemas.microsoft.com/SQLServer/reporting/repor tdesigner”> <DataSources> <DataSource Name=”AdvancedServices”> <rd:DataSourceID>e2e8470e-a912-4386-9f75-47b5bf26038b</ rd:DataSourceID> <ConnectionProperties> <DataProvider>SQL</DataProvider> <ConnectString>Data Source=VPC01-AAS\SQLEXPRESS;Initial Catalog=AdvancedServices</ConnectString> <IntegratedSecurity>true</IntegratedSecurity> </ConnectionProperties> </DataSource> </DataSources> <rd:ReportID>1e9ca36c-9c3f-4fe1-945d-cc3a9d23490c</rd:ReportID> <Width>5in</Width> <Body> <Height>0.97in</Height> <ColumnSpacing>0.5in</ColumnSpacing> <ReportItems> <Textbox Name=”textbox1”> <Style> <FontFamily>Tahoma</FontFamily> Unless you’re a glutton for punishment, you’ll want to do your report editing and debugging from within SQL Server Business Intelligence Development Studio rather than working with source code. When you’re done, you have a report that’s ready to be published. In the next section, I show you how to perform this final step. Publishing your report After all the work you’ve put in designing, building, and testing your report, it’s only logical that you make it available for others. You’re almost home; here’s what you need to do: 1. Launch SQL Server Business Intelligence Development Studio. If you left it running from the earlier sequence of steps, you can skip this step. 284 Part V: Putting the Tools to Work: Programming with SQL Server 2005 Express 26_599275 ch18.qxp 6/1/06 8:48 PM Page 284 2. Open the report project you created earlier. 3. Choose Build➪Deploy Report. If everything goes well, you see output similar to the following: Build complete 0 errors, 0 warnings Deploy started: Project: Report Project4, Configuration: Debug Deploying to http://localhost/ReportServer Deploying report ‘/Report Project4/Sales By Client’. Deploy complete 0 errors, 0 warnings ======== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ======== ======== Deploy: 1 succeeded, 0 failed, 0 skipped ======== If your reporting plans include browser-based access to information, you need to install and configure Web server software on your database server. With your report deployed, gaining access to it is quite easy. Assuming that you’ve set up the correct virtual directories and your Web server is running, all you need to do is instruct your users to point their browsers at the right report server. The users then can view the reports from within their Web browsers. Figures 18-14 and 18-15 show the sample report from the users’ perspective. You can print your report only on the client; server-side printing is not supported. Figure 18-14: The newly created report, header view. 285 Chapter 18: Full-Text Searching and Reporting Services 26_599275 ch18.qxp 6/1/06 8:48 PM Page 285 Maintaining your report After you build and deploy your report, performing standard maintenance is easy work. Here’s what to do: 1. Launch SQL Server Business Intelligence Development Studio. If you left it running from the earlier sequence of steps, you can skip this step. 2. Open the report project you created earlier. 3. Make changes as necessary and then save your work. You may elect to change the look and feel of your report, or you may be inclined to embark on more substantial alterations to your query logic. In either case, you can choose File➪Save or click the Save button to commit your changes. 4. Choose Build➪Deploy Report. That’s all there is to it: You just need to follow the same set of steps that you did during the original design cycle. If you’re considering making radical changes to a report, consider first creating a backup copy. With your original, working report backed up, you can safely proceed to make changes to your heart’s content. Figure 18-15: The newly created report, detail view. 286 Part V: Putting the Tools to Work: Programming with SQL Server 2005 Express 26_599275 ch18.qxp 6/1/06 8:48 PM Page 286 Part VI Creating SQL Server 2005 Express Applications 27_599275 pt06.qxp 6/1/06 8:49 PM Page 287 [...]... C# 2005 Express ߜ Visual C++ 2005 Express ߜ Visual J# 2005 Express 304 Part VI: Creating SQL Server 2005 Express Applications Despite their relative simplicity, you can still construct industrial-strength applications, using the Express Editions as your foundation This chapter’s goal is to help you leverage Visual Web Developer 2005 Express, so I focus on this software development technology Unfortunately,... copy of Visual Basic 2005 Express Edition For Dummies, by Richard Mansfield (Wiley) Just as Visual Basic 2005 Express represents a more easily understood implementation of Visual Basic, SQL Server 2005 Express offers a simpler set of features than those found in the more robust editions of the database server Anticipating that people building applications with Visual Basic 2005 Express need an easily... 302 Part VI: Creating SQL Server 2005 Express Applications If you’re distributing an application that makes local calls to a SQL Server 2005 Express database, you need to install the product on each of these computers If, on the other hand, the application makes remote calls to a centralized database, you don’t need to install SQL Server 2005 Express 1 Launch Visual Basic 2005 Express 2 Choose File➪Open➪Project,... deployed SQL Server 2005 Express as a low-cost, entry-level database product that just happens to be built on the feature-rich line of SQL Server database servers And you may not be building new applications, but are using this database as an information store for packaged software solutions and tools However, you could be interested in using SQL Server 2005 Express as the data storage foundation for new... Developer 2005 Express Edition For Dummies, written by Alan Simpson (Wiley Publishing) Visual Web Developer 2005 Express integrates nicely with SQL Server 2005 Express That’s a theme of this chapter, where I give you repeated examples of how closely the two products interoperate In fact, to encourage this coupling, when you download the development platform, Microsoft thoughtfully bundles the database server. .. Figure 19-7: A simple, yet powerful, databaseaware form in Visual Basic 2005 Express 297 2 98 Part VI: Creating SQL Server 2005 Express Applications 8 Stop debugging by closing the running form, and then save your new form by clicking the Save icon With your table and form now in place, you have tremendous control over the look-and-feel and behavior of their information Much of this power doesn’t even require... development technologies: ߜ Visual Basic 2005 Express ߜ Visual Web Developer 2005 Express ߜ Visual C# 2005 Express ߜ Visual C++ 2005 Express ߜ Visual J# 2005 Express 290 Part VI: Creating SQL Server 2005 Express Applications Although each of these programming language environments is somewhat less functional than the higher-end editions found in Visual Studio, you can still create very rich applications... database, using another tool, such as SQL Server Management Studio Express or the SQLCMD utility, then you need to associate this existing database to your new project Here’s how to do that If you left Visual Web Developer 2005 Express running, you can skip Steps 1 and 2 307 3 08 Part VI: Creating SQL Server 2005 Express Applications 1 Launch Visual Web Developer 2005 Express 2 Choose File➪Open➪Web Site,... extremely popular way of representing and storing information The final chapter of this part explains how to most advantageously meld XML, SQL Server 2005 Express, and your chosen development technology Chapter 19 Building a Simple Desktop Application with Visual Basic Express In This Chapter ᮣ Tying Visual Basic 2005 Express together with SQL Server 2005 Express ᮣ Creating a data infrastructure ᮣ Constructing... look-and-feel of the form now, or just wait until later 7 Choose Debug➪Start Debugging This step quickly compiles all the components and runs the form Congratulations! You have a working, albeit rudimentary, Visual Basic 2005 Express form, running in debug mode with full create, read, update, and delete capabilities for the SQL Server 2005 Express database Figure 19-7 shows what this form looks like Figure . with SQL Server 2005 Express 26_599275 ch 18. qxp 6/1/06 8: 48 PM Page 282 Figure 18- 13: The new report as seen from within SQL Server Business Intelligence Studio. Figure 18- 12: The settings for. 18- 15: The newly created report, detail view. 286 Part V: Putting the Tools to Work: Programming with SQL Server 2005 Express 26_599275 ch 18. qxp 6/1/06 8: 48 PM Page 286 Part VI Creating SQL Server. box. Figure 18- 8: Testing a database connection. Figure 18- 7: The New Project dialog box. 280 Part V: Putting the Tools to Work: Programming with SQL Server 2005 Express 26_599275 ch 18. qxp 6/1/06 8: 48

Ngày đăng: 08/08/2014, 22:20

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