To assist Visual Studio .NET developers in designing reports, Crystal Reports for Visual Studio .NET provides a collection of Report Experts, extremely similar to the Report Creation Wizards (covered in Hour 4, "Using the Default Report Wizards") available in Crystal Reports 9. The Report Experts will guide the Visual Studio .NET developer through the creation of a variety of reports while handling the details of how the report is created. The available Report Experts create several types of reports, including standard, form letter, form, cross-tab, sub-report, mail label, and drill-down reports, shown in Figure A.1. Figure A.2 displays the Standard Report Creation Expert dialog. Figure A.1. The Crystal Reports Gallery dialog allows Visual Studio .NET developers to access a variety of Report Creation Experts.Figure A.2. The Standard Report Expert is perhaps the most common expert used to create reports.Crystal Reports for Visual Studio .NET is composed of several components. Once a report is set up, either manually or by using one of the Report Experts, developers use the Crystal Reports Designer in Visual Studio .NET to modify, add, and format objects and fields, as well as to format the report layout and manipulate the report design, as shown in Figure A.3. The designer then generates .rpt files. (.rpt is the file extension for a Crystal Report.) Within the Visual Studio environment, these .rpt files are processed by the Crystal Reports engine, which delivers the report output to one of two Crystal Report viewers a Windows Forms viewer control or a Web Forms viewer control depending on the type of application the developer specifies. The report viewer then presents the formatted report information to the business user of the application. Figure A.3. The Crystal Reports for Visual Studio .NET design environment.Using Crystal Reports in Web ApplicationsA developer, using Crystal Reports for Visual Studio .NET, can integrate highly interactive reports into a Web page. Dynamic Web applications are made possible through ASP .NET technology integrated into Visual Studio .NET. Crystal Reports for Visual Studio .NET provides a Web Forms Report Viewer, which is a Web Form (HTML files with embedded Web Controls and code files that contain event-handling logic) that hosts the report. When a client (end business user) accesses such a Web form, the event handler can update and format information in a Crystal Report and send the updated report to the business user of the application.[7]
One of the walkthroughs available on the Crystal Decision's Web site instructs Visual Studio .NET developers how to enable Web page interactivity and how to use ASP .NET and its controls. In this walkthrough, the business user of the application accesses information about countries by first entering a country name into a text box, and then submits the information. The country name is passed to the Web forms viewer control and the report is updated. Using Crystal Reports with Web ServicesUsing Crystal Reports for Visual Studio .NET, any Crystal Report created in C# can be published as an "XML Report Web Service" as shown in Figure A.4. A Web service provides methods that are accessible over the Internet to any application, independent of programming language or platform. As an example, an XML Report Web Service could be an excellent mechanism with which business partners could access specific report information. Visual Studio .NET generates a DLL file (dynamic link library) that contains the report and an XML file when a Crystal Report is published as an XML Report Web service. Both files are published to a Web server so that a client machine (business user) can access the report. An XML-based SOAP message passes the data to and from the Web service. When a developer uses Visual Studio .NET to create and publish the Web service, the developer can associate the Web service to either a Windows or a Web application to display the data returned from the Web service. Figure A.4. Crystal Reports can be published as a Web Service within the Visual Studio .NET design environment.One of the great things about using a report as a Web service is that it allows companies to exchange corporate information without passing the actual data. Rather than opening up your database to a partner, you can build a report off it and have the report exposed as a Web service. The report is still executed at the host company, alleviating any security issues, but the partner consuming the report can benefit from the insight it provides. Again, Crystal Decisions provides a good example, via a walkthrough, of the steps necessary to familiarize developers with implementing a report as a Web service. To truly understand the value and implementation of a Crystal Report Web service, it's useful to consider a common scenario. Let's assume that company A has a large regional distributor network and needs to share sales information with these distributors on a regular basis and has built a sales report used internally to understand this information. Company A would like to use this same report to serve external audiences. The following example provides an illustration of how company A can build an XML report Web services application to enable business partners to access relevant information:
Company B (business partner of company A) builds a C# Windows application within Visual Studio .NET that consumes the XML report Web service created by company A:
|