|
In this chapter we will develop Visual Basic applications that incorporate Crystal Reports 9. As you have seen in Chapter 17, “The Crystal Programming Forest,” there are many ways to program Crystal Reports in an application; this chapter focuses on building applications using Visual Basic 6 and the Report Designer Component (RDC). Because of the similarities between the Visual Basic language and VBScript (a subset of the VB language, which is used when developing ASP applications), the RDC examples we include in this chapter can be used in Windows and ASP development. Chapter 20, “ASP Web Applications,” focuses on differences when working within a web environment. We will not focus on Visual Basic or Windows development; rather, we will focus on using the RDC. We start by installing the RDC in Visual Basic, and then we will open a report and manipulate it via the RDC.
The RDC is a large object model that exposes all the functionality of Crystal Reports through its objects. We will cover the main components of the RDC and show you techniques for working with it. Once you understand one technique and how the components are organized, you can apply the same technique to other parts of the RDC object model. We will keep our examples straightforward so you can easily use our sample code in your application.
If you are comfortable with working with objects and object-oriented programs, then you can jump right into this chapter. If you are new to object-oriented programming (OOP), we recommend reading Chapter 18, “The Object-Oriented Primer,” so you can understand the OO terms and techniques required to program with the RDC. It is also important to understand the functionality of Crystal Reports before working with the RDC because the RDC allows you to control Crystal Reports functionality through code. If you know the capabilities of Crystal Reports, it will be easier to understand how to use the RDC.
In this chapter, we will examine the following topics:
Installing the RDC
Opening existing reports
Changing selection criteria
Modifying group and sort criteria
Setting database logon parameters
Switching databases
Working with graphs and subreports
Modifying the Crystal Viewer
Designing reports in Visual Basic
The code sample in this chapter can be downloaded from the Sybex website at www.sybex.com.
Use of content on this site is expressly subject to the restrictions set forth in the Membership Agreement | |
Conello © 2000-2003 Feedback |