There are a number of sample applications that ship as part of Crystal Enterprise Embedded (RAS standalone). This section describes these sample applications. It is important to note that the purpose of these examples is to demonstrate the basic capabilities of RAS in action and to provide sample starting points for further application development. In some cases you will find these immediately useful for allowing your users to perform simple tasks like viewing reports, setting report data sources at runtime, changing the selection formula at runtime, or passing parameters to reports. In the majority of cases, it is expected you will be able to leverage the concepts and sample code as starting points into developing your own rich and more full-featured applications.
The Report Preview Sample is an application that demonstrates report viewing using Crystal Enterprise Embeddeds RAS (see Figure 31.5). The frame on the left represents the directory structure as it appears starting at the root of the default RAS reports directory. By default, this directory is c:program filescrystal decisions eport application server10 eports. After a report is selected to view, it appears inside the bottom-right frame. The top-right frame lists report viewers that are available with RAS. You can toggle between the viewers available by selecting the desired option in this frame.
Additional information on the report viewers for RAS and their programmatic hooks and controls is provided in the next chapter.
The Simple Discrete Parameter example shown in Figure 31.6 provides a demonstration of a report running with parameters. As previously discussed in this book, there are often cases where reports are required to run with parameters against the database. Some of these parameters might be passed in without the report consumer even being aware of them (for example, global environment variables to set a users preferred language for report viewing). Other types of parameters require user input where the user is presented with a list of values to choose from and a report is run using those selected values and limits the resultset displayed in the report.
The Database Logon example illustrates the capability for the end user to supply his own logon credentials to the report when it is retrieving data from the database. This scenario is commonly found in implementations where users should only be able to see data that pertains to them and user-level database security has been set up. An example of this might include a sales executive for the eastern region and his counterpart for the western region viewing the same pipeline reporteach executive only needs to view information for his specific geographies. When either of them views the report, they are prompted to supply logon information (see Figure 31.7) to continue and this information is passed to the database and the appropriate user-level security is applied there.
The Set Data Source Location sample demonstrates the task of setting the location of the database to be used for the involved report at runtime. This example might be useful in scenarios where you need to run the same report against different environments (such as Development, Testing and Quality Assurance [QA]). Another practical example would be in the scenario where different versions of identical databases are kept across an organization. You might want to enable the application users to decide what data source to dynamically run the report against (for example, different regional databases). In this case, a custom Web page could be developed to let the user make the desired choice and then use the RAS functionality to connect the report to the selected database.
Examples discussed in this section are included with the out-of-the box installation of the RAS (Crystal Enterprise Embedded in version 10) and can be leveraged by reusing the source code distributed as part of the installation.