Chapter 1. Integrating Crystal Reports into an ASP.NET Application

Crystal Reports for .NET is an easy-to-use tool that allows you to integrate reports into a .NET application. Best of all, it comes free with Visual Studio. Many business applications written in ASP.NET are rolled out with cool web pages that use the GridView, Web Part, Login, and ASP.NET AJAX controls, which makes it easy to get a web site up and running quickly. These controls are great for getting data into a database easily and retrieving data, but if you want to impress upper management — who don't use the application — you want to produce great-looking and information-rich reports. This Wrox Blox walks you through creating reports using Crystal Reports for .NET, how to view reports using the Crystal Reports Viewer controls, and how to manipulate the report at runtime using the Crystal Reports object model.

The samples discussed in this Wrox Blox use the AdventureWorks database, which is a sample database provided by Microsoft. The database is based on a fictitious company that manufactures metal and composite bicycles. You can download the sample database at www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004. Click on the AdventureWorksDB.msi file to download it to your computer. Once it is downloaded, run the msi file. This will take you through a wizard to install the database; however, the install only copies the database file to your C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData folder. Follow these steps to attach the database files in SQL Server Management Studio:

  1. Right-click on the Databases folder in SQL Server Management Studio and select the "Attach" menu item.

  2. The Attach Database dialog box should appear. Click on the "Add" button.

  3. This will open the Locate Database Files dialog. Select the AdventureWorks_Data.mdf file from the list of files. Click OK, and then click OK again on the "Attach Databases" dialog.

You should now see the AdventureWorks database in your list of databases in SQL Server Management Studio. Now you're ready to start building reports.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset