Understanding the CrystalDecisions.CrystalReports.Engine Namespace
If you have worked with Visual Basic and Crystal Reports before, you are probably familiar with the functionality within the Crystal Reports Engine. The Crystal Reports Engine provides a low-level interface into the report itself, and allows developers to control most aspects of the report programmatically.Within Visual Studio NET, the CrystalDecisions.CrystalReports.Engine namespace is used to expose this functionality. If you are integrating your reports in a simple view-only application, you may never need to delve into the Crystal Reports Engine, but for more complex integration and applications, you will find you'll need to use it almost every time.Remember our earlier discussion in Chapters 3 and 4 about which namespace you should use for what function? One of the key points of that discussion was that you shouldn't mix the object models in your code. For example, if you do choose to use the CrystalDecisions.CrystalReports.Engine namespace, set all of your properties, methods, and events relating to the report using this namespace and use the CrystalDecisions.Windows.Forms namespace only for setting your report source, viewing the report and modifying viewer properties (such as toolbars and icons). Never the twain shall meet!