01 557300 Ch01.qxd 3/24/04 9:37 AM Page 1 Cr ystal Repor ts .NET Over view Crystal Reports has enjoyed a long association with Microsoft and has shipped with Visual Basic (and subsequently Visual Studio) as the default report writer since 1993. Developers have traditionally had a love-hate relationship with Crystal Reports; they loved the functionality it provided and the free run-time license, but they hated having to upgrade to the latest version to get the features they required.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 2 Chapter 1 What Is Cr ystal Repor ts? In simplest terms, Crystal Reports is a report design tool that allows you to create reports capable of retrieving and formatting a result set from a database or other data source.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 3 Crystal Reports .NET Overview A Brief History In the beginning, a small company in Vancouver called Crystal Services developed a DOS-based reporting add-on for ACCPAC accounting in 1988. A few years later, in 1992, the company released Crystal Reports, touting it as the “world’s first Windows report writer,” and it wasn’t too long after that Microsoft standardized Crystal Reports as the reporting engine for Visual Basic. The rest is history.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 4 Chapter 1 This Report Designer (covered in Chapter 3, “Designing Reports”) features a number of experts (or wizards) to help you get started creating a report. It will guide you through the report development process, from selecting a data source and the field that will appear on your report, to determining what records should appear.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 5 Crystal Reports .NET Overview Figure 1-3 For creating distributed applications, Crystal Reports .NET has a number of features specifically designed for creating and consuming XML Report Web Services, either through the generic Web Service that ships with Crystal Reports .NET (which allows you to utilize a report without having to publish it as a Web Service) or by creating your own Web Services from report files, like the one shown in Figure 1-5.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 6 Chapter 1 Figure 1-4 Figure 1-5 Crystal Reports .NET is also tightly integrated with Crystal Enterprise, a report scheduling and distribution system that provides a true multi-tier back-end processing platform for reports and allows you to use a scheduling engine and distribution framework to distribute reports to thousands of users.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 7 Crystal Reports .NET Overview And finally, there are a number of tools that have been included for distributing reports with your application, including updated merge files for this version of Crystal Reports. In Chapter 10, “Distributing Your Application” we will look at how to use these tools to successfully deploy your own applications and how to trouble-shoot installation and setup problems. How Is Cr ystal Repor ts .
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 8 Chapter 1 Integration Methods If you are new to Visual Studio .NET in general and have not used Crystal Reports .NET before, another thing you’ll note is that the way that we integrate reports into both Windows and Web applications is different. Before Visual Studio .
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 9 Crystal Reports .NET Overview Reports that have been published to the Crystal Enterprise framework can be accessed directly from within Visual Studio .NET and integrated into your application.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 10 Chapter 1 Although the Seagate Info SDK seemed like a good idea, developers were slow to adopt the technology and looked for other ways to create multi-tiered applications. This led Crystal Decisions to rethink their product roadmap, and using the basic technology and architecture from Seagate Info, they created Crystal Enterprise, which was initially released in 2001.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 11 Crystal Reports .NET Overview Web Form Web Form Viewer Crystal Report Web Crystal Print Engine Data Figure 1-6 Three-Tier A true three-tier reporting application, like the one shown in Figure 1-7, can be (but doesn’t have to be) created using XML Report Web Services (covered in Chapter 6, “Creating XML Report Web Services”). A Report Web Service is a Crystal Report that has been exposed as a Web Service to be used (or consumed) by an application.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 12 Chapter 1 In addition to being able to expose reports as Web Services for internal users, you can also publish Report Web Services to users external to your organization, providing a method for external users to access data held within your own data sources.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 13 Crystal Reports .NET Overview Figure 1-9 To start, Crystal Reports .NET has extended support for a number of data sources, including ADO .NET, OLE DB (ADO), ODBC (RDO), Access/Excel files (DAO), Crystal Field Definition files (from previous versions of Crystal Reports), and XML. When working with these data sources, Crystal Reports .NET can utilize either a pull or push mode of data retrieval.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 14 Chapter 1 Incompatibilities When using the Crystal Reports Designer available in Visual Studio.NET, you’ll notice that there are a number of features that are available in the retail versions of Crystal Reports but are not supported here. A list of these features has been included for your reference: ❑ Geographic mapping is not supported in Crystal Reports for Visual Studio .NET.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 15 Crystal Reports .NET Overview Tight Visual Studio .NET Integration From within Visual Studio, accessing a new report is as easy as selecting Project → Add New Item and then selecting Crystal Report. There is no need to open a separate application to design reports, and all of the reporting features are available to you, allowing you to programmatically control the look and feel of a report, how it is processed and viewed, and so on.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 16 Chapter 1 For more information on deploying your Crystal Reports .NET application, go to Chapter 10, “Distributing Your Application.” ADO .NET With the introduction of ADO .NET, data access has become much easier, and Crystal Reports .NET can take advantage of ADO and the ADO .NET dataset. Instead of having to work out how to access various data sources, Crystal Reports .NET can simply access the ADO .NET dataset as the source for any report you may create.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 17 Crystal Reports .
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 18 Chapter 1 Once it is installed, the Crystal Reports icon will appear on the Visual Studio .NET splash screen, and from the Add New Item menu, you should see the option to add a new Crystal Report, as shown in Figure 1-12. Figure 1-12 With the installation complete, we can jump right into looking at the samples that are installed with the product and learning about Crystal Reports .NET. Learning from Sample Applications Crystal Reports for Visual Studio .
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 19 Crystal Reports .NET Overview samples, shown in Figure 1-13, are located at X:\Program Files\Microsoft Visual Studio.NET 2003\Crystal Reports\Samples\Code (where X: is the drive where you have installed Visual Studio .NET). There are two sets of sample applications available, both of which are bundled in self-extracting files — WebForms.exe and Winforms.exe. The first, which will extract to a folder marked WebForms, is written using ASP .
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 20 Chapter 1 The following samples are included in this set: Sample Description Simple Page The Simple Page sample application demonstrates using the Web Forms Viewer with one of the sample reports (World Sales). This sample demonstrates drilling down into the details of the report and some of the other features of the report viewer, including the report group tree, the viewer toolbar, and the page control options.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 21 Crystal Reports .NET Overview Sample Data A sample database has been included with Crystal Reports .NET, and the sample reports listed previously are based on this database. The Xtreme Mountain Bike Company database (xtreme.mdb) shown in Figure 1-14 is an Access database that contains tables for Customers, Orders, Products, Suppliers, and Employees. It does not require a copy of Access to be installed or loaded on to your machine to be used.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 22 Chapter 1 There are a number of tutorials available: ❑ Reporting off ADO .NET Datasets ❑ Viewing a Report in a Web Application ❑ Designing and Viewing a Report in a Windows Application ❑ Exposing Reports as Web Services ❑ Interactivity and Reports in Web Applications Most of these tutorials can be completed using the sample database and reports that ship with the product, or you can go through the tutorial using your own reports and data source.
01 557300 Ch01.qxd 3/24/04 9:37 AM Page 23 Crystal Reports .NET Overview You can also find more information (and post a question if need be) on Microsoft’s public newsgroups. The majority of Crystal-related questions, regardless of version or language, get posted to microsoft. public.vb.crystal, but there are always a few questions posted in the general dotnet newsgroup microsoft.public.dotnet.general. You will need a newsgroup reader, such as Outlook Express, to access these newsgroups.
01 557300 Ch01.