Customizing Reports Using the Report Engine

To get started, we will need to create a new project within our solution. To create a new project, select File ^ New ^ Project. In this instance, create a Windows application, and call the project engine_basic because, in the following sections, we are going to be looking at some basic Report Engine functionality.

We need a report object to work with. To add the sample reports to your project, select Project ^ Add Existing Item, and select the folder where you unzipped the sample project. You will also need to change the file extension from VB Code Files to All files to see the report files we will be using in this chapter, including the first report, Crystal.NET2 003\Chapter09\employee_listing.rpt.

With a report to work with, we now need to reference the Report Engine so we can use it in our application. This reference may well add itself when you add the report to the project, but, if not or if you are working with one of your custom reports, this will have to be added in Visual Studio .NET. To add a reference, select Project ^ Add Reference to open the dialog shown in Figure 9-1:

Figure 9-1

Highlight the CrystalDecisions.CrystalReports.Engine namespace, and click the Select button and then the OK button to add the reference. The reference to the Crystal Report Engine should now appear in your project in the Solutions Explorer, under the References folder—we are now ready to go.

Was this article helpful?

0 0

Post a comment