Where to Go from Here
The BusinessObjects Enterprise SDK is the most flexible and powerful way to access BusinessObjects Enterprise. Using the SDK, you can do create custom BI applications that meet the look, feel, and integration requirements of your project. The focus of this chapter was to understand the InfoStorethe object-relational repository where all BusinessObjects Enterprise assets are
Chapter 31. Using the Web Components
This chapter explores a series of rapid development options that permit you to quickly integrate BusinessObjects Enterprise XI with your enterprise applications. These include the capability to view, create, and edit
This section of the book is
In this chapter, URLs are referred to as dispatchers or handlers . This means that these files dispatch or handle other filesin this case, any .rpt , .car , or .wid report file. This design pattern provides utmost flexibility by not binding the service to any one particular report.
Historically, Crystal Enterprise customers were accustomed to using the viewrpt.cwr dispatcher. Classic Business Objects customers, by contrast, were accustomed to the openAnalytic.jsp dispatcher. BusinessObjects Enterprise XI includes a new dispatcher called openDocument.jsp/aspx. OpenDocument is the most flexible of the dispatchers and moving forward, it will be the preferred approach.
Viewing a Crystal Report or OLAP Intelligence Document with viewrpt.cwr
Before discussing openDocument.jsp/aspx,
Viewrpt.cwr is a Crystal classic technology whose implementation has evolved slightly with BusinessObjects Enterprise XI. In a Java environment, viewrpt.cwr is a mapping to the viewrpt servlet. In an ASP or .NET environment, viewrpt.cwr is redirected to viewrpt.aspx or viewrpt.asp.
Although it cannot display Web Intelligence documents, viewrpt.cwr enables a variety of ways for viewing Crystal
For desktop Windows applications, there is no equal to the CRViewer1 ActiveX control,
Additionally, viewrprt.cwr supports a powerful use case where you can programmatically push the entire reportClientDocument into the viewer via a shared session variable, identified in the URL query string.
For additional information on viewrprt.cwr, please
Viewing a Crystal Report, Web Intelligence Document, or OLAP Intelligence Document with OpenDocument
OpenDocument, new to BusinessObjects Enterprise XI, provides the ability to integrate a wide variety of InfoView objects into your development projects, as well as interlink reports to one another.
Several scenarios include
Between Crystal Reports, report-to-report linking can also be accomplished using the built-in navigation in the Hyperlink tab of the Format Editor. This capability requires practice to master, but elegantly supports cut-and-paste report part linking.
For readers familiar with the Crystal Report viewer SDKs, OpenDocument might not seem like a big dealimplementing a custom viewer is easy. You will find a
Now that you know
to use it, and a bit about
to use OpenDocument is discussed
OpenDocument.jsp and OpenDocument.aspx
In the Java environment, the OpenDocument dispatcher is called OpenDocument.jsp and can be found at the following
In the .NET environment, the same functionality can be found at
The OpenDocument dispatchers require parameters in the form of a URL query string (the part after the "?" in a URL) in order to function. Query strings are collections of ParamName/ParamValue pairs separated by equal signs ("=") and joined together by ampersands ("&").
A sample syntax for opening the World Sales Report without prompting a login is
[View full width]
The first part of the URL refers to the machine and application server port. A default Apache Tomcat installation is run locally, so the server
Table 31.1 describes each of the supported parameters and its use. For brevity, the full URL path and the token argument has been omitted from the example URLs. If a user has already logged into InfoView or a token has been provided in a prior request, the token parameter is optional because it has already been
Table 31.1. OpenDocument URL Parameters
The Document ID is an internal integer identifier that cannot be easily determined from InfoView. You should navigate to the document in the Central Management Console. In the File Name string, you see the path within the File Input Server. Every document has its own subfolder that the document ID corresponds with the internal identifier. Here, the document ID is 306. If you click on Preview, the following URL is shown in the browser: http://dcakrinsky02:8080/businessobjects/enterprise11/admin/en/
Figure 31.1 shows how a report part is named using the Object Name property of the Common tab of the Crystal Reports Object Format editor. Figure 31.2 shows a report part rendered using the sReportPart syntax in the previous example.
Figure 31.1. Report Part Names are set in the Crystal Report Format Editor window.
Figure 31.2. Viewing a Report Part.
Figure 31.3 shows a particular, non top-level report part, Country, known by the dimension USA in the report
Figure 31.3. Report part context in Full mode.
Figure 31.4 shows the same report part as the prior example, but without contextual data. This is called Part mode.
Figure 31.4. Report part context in Part mode.
Following is a summary of differences between Web Intelligence documents and Crystal Reports accepting multiple prompt values.
For filling prompts that accept multiple values (in list):
For filling prompts that accept multiple values:
Context is a fairly complex topic covered elsewhere in this book. If there are multiple ways to resolve a SQL query, the context must be specified in order for the Universe to pass the Designer integrity check. Figure 31.5 shows how context is defined in the Universe Designer.
Figure 31.5. The context definition in the Universe Designer.
As shown in Figure 31.6, the end-user is prompted if a valid value for lsC is not provided.
Figure 31.6. The context run-time prompt.
Creating an OpenDocument Link in Crystal Reports
To open another report from Crystal Reports, use the Hyperlink tab of the Field Format Editor and follow these steps:
You can test the formula by creating a temporary parameter that uses the same formula and outputting it directly on your report. Click the Save and Close button in the Formula Workshop to continue.
Creating an OpenDocument Link in OLAP Intelligence
Although not the focus of this book, OLAP Intelligence is a very welcome tool in the quiver of any Business Objects customers that have deployed traditional OLAP databases. Among its more powerful features is the capability to define custom actionsa welcome addition to Crystal Analysis v.10 that also made it into XI. Prior to this enabling feature, you needed to define actions in the underlying OLAP database. Follow these steps to create a hyperlink from an OLAP Intelligence document using the openDocument.jsp/aspx dispatcher:
Actions for OLAP Intelligence are covered in more detail in Chapter 19, "Creating OLAP Intelligence Reports."
Earlier in the chapter, the token parameter was discussed from the perspective of single sign-on from a third-party application. When linking between reports, there is no way to insert the user's session token in the link. OpenDocument does not require a token if a user session is already active. If the session times out or if it's the first report link the user ever clicks, OpenDocument automatically redirects the user to a login page.
Creating a New Web Intelligence Document
With the release of the near feature parity 0-client (IE, Netscape [Mozilla], and Safari) Web Intelligence document editor, exposing industry-leading ad hoc analysis capabilities to intranet and extranet customers is arguably the most compelling new feature in all of Business Objects XI. As a result, it was surprising to find no dispatcher that
First, you can call the InfoView STRUTS action that
Figure 31.7 shows a page inside a frameset. Clicking on a Universe name in the Title column opens either the DHTML or Java query panel, depending on a user's InfoView preferences.
Figure 31.7. Creating a new Web Intelligence document.
Because InfoView is likely to be rewritten and the new.do action is undocumented, this approach might break in
The second approach is to actually write dispatchers to create new WebI documents inside the DHTML and Java query panels. The code for the Java query panel actually comes from the Developer suite and is fully documented there. The code for the DHTML query panel wrappers an InfoView JSP file, openQueryPanel.jsp, that is subject to change in future releases. For both approaches, you need to first create a session token, check permissions to create Web Intelligence documents, and retrieve a list of Universes. This code is already provided in Chapter 30 and is not repeated here.
Displaying a List of Universes
The last chapter showed how to query the InfoStore to retrieve a list of Universes. This and code showing how to determine a user's rights vis--vis creating WebI documents are encapsulated in the utility function BOEUtil.java found on www.usingcrystal.com. Listing 31.1 shows how functions are used to render a list of Universes from which a user can create new WebI documents using either the DHTML or Java viewers.
Listing 31.1. Universes.jsp
Creating a New Web Intelligence Document in the Java Query Panel
You can find the complete code listing for the webiAppletOpenQueryPanel.jsp and the companion webiAppletSaveDoc.jsp files at www.usingcrystal.com. To give you a sense of what is involved, a partial code listing is shown in Listing 32.2. Remember that for the applet to work properly, you must configure the cadenza servlet in web.xml, through which the Java applet communicates with the WebIntelligence Report Engine, before samples like this will work properly.
Listing 31.2. Snippets from webiAppletOpenQueryPanel.jsp
Creating a New Web Intelligence Document in the DHTML Query Panel
The DHTML query panel is comprised of a series of JSP pages. One of them is a file called openQueryPanel.jsp that does everything you want it to do except log in the user. In order to create a new WebI document without InfoView prompting the user to enter credentials, you need to put a login page in front of openQueryPanel.jsp that logs in the user and then forwards the request to it. Place the login page in the /desktop/InfoView/viewers/cdz_adv/directory . The full listing, webiDHTMLOpenQueryPanel.jsp, is posted on www.usingcrystal.com.
URL Parameter Building Tips
Conventions that apply to building any URLs apply here. Since
Because name-value pairs in a URL are delimited by = and separated from one another by &, values containing these and certain other special
Encoded values appear as three-letter codes, starting with % and ending with the two-letter hexadecimal representation of the encoded character byte. Naturally, % is also a special character that must be encoded. Normally, this work is done by URL encoder/decoder functions in your development environment of choice. The rules for URL encoding are provided in Table 31.2.
Table 31.2. URL Encoding Conventions
Here are some other tips for building URLs in Business Objects and sometimes elsewhere: