Thus far, the chapters on the Crystal Enterprise Object Model have focused on delivering relational Crystal Reports. This section discusses delivering Crystal Analysis reports in custom Web applications.
NOTE
Crystal Reports can report off OLAP data sources such as Microsoft SQL Server Analysis Services as well. However, Crystal Reports provides OLAP Reporting as opposed to what Crystal Analysis provides, which is OLAP Analysis. If all you need is to view snapshots of a cube's data, Crystal Reports is the best solution. However, the real power of building OLAP cubes is in the explorative analysis that can be performed. Instead of simply answering the "what" and "when" and "who" questions, that OLAP analysis provided by Crystal Analysis can answer the "how" and "why" questions.
Discovering Crystal Analysis Reports
The first thing you should understand when learning about working with the Crystal Enterprise object model and Crystal Analysis is that the Crystal Analysis report files (.car files) are hosted as InfoObjects just like all other objects in Crystal Enterprise. The object type for these reports is CrystalEnterprise.Analysis. The following is an InfoStore query that returns all Crystal Analysis reports stored in a given system:
SELECT SI_ID, SI_NAME FROM CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Analysis'
As you can see the SI_ID and SI_NAME properties apply to Analysis reports the same way as they do to Crystal Reports. Some other InfoStore properties that are applicable to Crystal Analysis are
Unlike Crystal Reports, Analysis reports cannot be scheduled. However, a user can create a saved view of a Analysis report. A saved view is simply a certain viewpoint and state of the report that is saved as another InfoObject. Like Crystal Report instances, saved views are children of the original report in the Crystal Enterprise repository. The following query would be used to return only reports and not saved views:
SELECT SI_ID FROM CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Analysis' AND SI_SAVED_VIEW=0
Notice that the SI_SAVED_VIEW property is used much the same way as the SI_INSTANCE_OBJECT property is used for Crystal Reports.
Viewing Reports
Unlike Crystal Reports, Crystal Analysis does not have the corresponding object or component that is used to view reports. Instead reports are viewed by redirecting to a URL with a certain syntax that indicates which report to view and some other information. This URL is handled by the Web Component Server, which calls out to the Crystal Analysis engine to display the report. This ends up being a much easier solution anyway. The report can be loaded into a frame if needed as well. The URL used to view Crystal Analysis reports is as follows:
http://SERVER/crystal/infoobject.cwr
This infoobject.cwr URL accepts the following arguments along the query string:
NOTE
Any of these items can also be passed via an HTTP form post to hide their values from the end user.
A sample URL is provided here:
infoobject.cwr?id=243&action=0&wcslogontoken=CRYSA:84g323fms3adgmeh&page=1
Figure 36.6 shows the result of this URL.
Figure 36.6. Viewing a Crystal Analysis report.
Passing Parameters to Crystal Analysis Reports
A new feature to Crystal Analysis is parameterized reports. A parameter can be used to set the cube location, page, member set, or member. When viewing a report that has a parameter defined and using the URL from the previous example, the Crystal Analysis report viewer would pop up a message asking the user to type in a value for the parameter. Often it's preferable to bypass that parameter prompting screen and pass the parameter value to the viewer directly. This is done via the promptex query string item.
The syntax for the promptex query string item is as follows:
Single value: promptex-NAME=VALUE
Multiple value: promptex-NAME=KEY%3DVALUE,KEY%3DVALUE,...
For single value parameters, use the first syntax, replacing NAME with the name of the parameter as defined in the Crystal Analysis designer, and VALUE with the value required. The following example would pass the value 2004 to the Year parameter:
promptex-Year=[Time].[2004]
Some other examples are listed here:
promptex-PageNo=4
promptex-ProductsMembers=[Products].[Meat],[Products].[Dairy]
Part I. Crystal Reports Design
Creating and Designing Basic Reports
Selecting and Grouping Data
Filtering, Sorting, and Summarizing Data
Understanding and Implementing Formulas
Implementing Parameters for Dynamic Reporting
Part II. Formatting Crystal Reports
Fundamentals of Report Formatting
Working with Report Sections
Visualizing Your Data with Charts and Maps
Custom Formatting Techniques
Part III. Advanced Crystal Reports Design
Using Cross-Tabs for Summarized Reporting
Using Record Selections and Alerts for Interactive Reporting
Using Subreports and Multi-Pass Reporting
Using Formulas and Custom Functions
Designing Effective Report Templates
Additional Data Sources for Crystal Reports
Multidimensional Reporting Against OLAP Data with Crystal Reports
Part IV. Enterprise Report Design Analytic, Web-based, and Excel Report Design
Introduction to Crystal Repository
Crystal Reports Semantic Layer Business Views
Creating Crystal Analysis Reports
Advanced Crystal Analysis Report Design
Ad-Hoc Application and Excel Plug-in for Ad-Hoc and Analytic Reporting
Part V. Web Report Distribution Using Crystal Enterprise
Introduction to Crystal Enterprise
Using Crystal Enterprise with Web Desktop
Crystal Enterprise Architecture
Planning Considerations When Deploying Crystal Enterprise
Deploying Crystal Enterprise in a Complex Network Environment
Administering and Configuring Crystal Enterprise
Part VI. Customized Report Distribution Using Crystal Reports Components
Java Reporting Components
Crystal Reports .NET Components
COM Reporting Components
Part VII. Customized Report Distribution Using Crystal Enterprise Embedded Edition
Introduction to Crystal Enterprise Embedded Edition
Crystal Enterprise Viewing Reports
Crystal Enterprise Embedded Report Modification and Creation
Part VIII. Customized Report Distribution Using Crystal Enterprise Professional
Introduction to the Crystal Enterprise Professional Object Model
Creating Enterprise Reports Applications with Crystal Enterprise Part I
Creating Enterprise Reporting Applications with Crystal Enterprise Part II
Appendix A. Using Sql Queries In Crystal Reports
Creating Enterprise Reporting Applications with Crystal Enterprise Part II