Before detailing the code used to display the parameters for
a particular report, let’s go over the architecture of the classes used. The Crystal assemblies are encapsulated within new assemblies that add functionality. The new
classes do not extend Crystal assemblies using inheritance, but rather by
referencing the Crystal objects when needed.
The reasoning for this includes the fact that some of Crystal contains COM components. I have found that wrapping these objects into my own assemblies
helps with certain problems associated with third party software. Specifically
there have been problems with nUnit and Crystal assemblies that have been
solved by using separate assemblies to call Crystal.
For these reasons, our source code now contains a class CRParameterPanel.
This class is a refinement of an earlier article
that did some of these same functions. Instead of doing all the panel building
activity within the page, this class inherits a panel from the class System.Web.UI.Webcontrols.
We’ll add the parameter input controls to the panel. Also, in Part 4, the
panel is where the report viewer will display.
Currently for purposes of this article, these classes are
contained in the project Lancor.CrystalReportManager. Best practice dictates
that these classes should be in their own project, separated from the UI.
Perhaps this will happen for a future version of this.