Connecting to databases during runtime gives a reporting solution great flexibility for using a single report to print with different data sources and dynamic queries. Reports can dynamically print data from different servers, different types of databases, and customized queries.
To be honest, this chapter has a lot of meat on its bones. There are many variations for performing data connectivity and it can be overwhelming at first. It’s best to read this chapter in its entirety to get a good understanding of how everything works. Then decide the best option for implementing your report. Scan through the chapter and look for the code examples labeled for your chosen interface method. Each piece of the code is complete and the sample report it runs against is deliberately kept simple. Most of the code can be used with any report without modifications.
Chapter 13 showed how to connect to data sources using the Visual Studio IDE. This consisted of using the different wizards to select the data source, specify the fields to print, and work with SQL statements. This chapter focuses changing the data source of an existing report during runtime. Using the Crystal Reports object during runtime gives you more power than working solely with the Visual Studio IDE.