Customizing Web Intelligence with REBean

BusinessObjects Enterprise XI Windows and UNIX


If you find any problems with this documentation, please report them to Business Objects S.A. in writing at Copyright © Business Objects S.A. 2004. All rights reserved.


Business Objects, the Business Objects logo, Crystal Reports, and Crystal Enterprise are trademarks or registered trademarks of Business Objects SA or its affiliated companies in the United States and other countries. All other names mentioned herein may be trademarks of their respective owners. Business Objects owns the following U.S. patents, which may cover products that are offered and sold by Business Objects: 5,555,403, 6,247,008 B1, 6,578,027 B2, 6,490,593 and 6,289,352.


Chapter 1 Chapter 2 Introduction Introduction to WebIntelligence SDK 7 9 Packages for customizing WebIntelligence . . . . . . . . . . . . . . . . . . . . . . . . 10 Migrating to BusinessObjects XI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 A typical Web Intelligence SDK application . . . . . . . . . . . . . . . . . . . . . . . . 11 Chapter 3 Application Essentials 15

“Hello World” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 BusinessObjects Enterprise sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Implementing “Hello World” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 User preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Exception handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Reporting essentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Chapter 4 Document Management 33

Document types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Document state: storage tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Organizing documents in categories and folders . . . . . . . . . . . . . . . . . . . . 39 Working with documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Document properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Chapter 5 Viewing Web Intelligence Reports 61

Viewing reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Handling prompts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Displaying a report map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Chapter 6 Drilling in Web Intelligence Reports 79

Introduction to drilling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Drilling in Web Intelligence reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

Customizing Web Intelligence 3

. . . . . . . . . . . . . . . . . . 92 Building a data provider . . . . . . . . . . . . . . . . . . . . . . . . . . consulting and training . . . . . . . . . . . . . . . . . . . . .Chapter 7 Building and Editing Data Providers 91 Data providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Executing queries and retrieving the data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Useful addresses at a glance . . . . . . . . . . . 124 Customer support. . . . . . . . . . . . . . . . . . . . . . . . . . 120 Appendix B Business Objects Information Resources 123 Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Appendix A Working with Recordsets 119 Anatomy of a recordset . . . . . . . . 116 Page layout . . . . . . . . . . . . . . . 127 Customizing Web Intelligence 4 . . . . . . . . . . . . . . . 102 Chapter 8 Formatting Reports 103 Creating and editing the document structure . . . . . . . 104 Creating and editing cells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Examples Referencing BusinessObjects Enterprise SDK 17 Instantiating the ISessionMgr class 18 HTML form for gathering a user’s login information 19 Establishing a session 20 Printing a user’s preferences 26 Setting a user’s report panel preference to Java 28 Adding a new preference to a user’s profile 29 Importing the REBean package 31 Instantiating a ReportEngine object 31 Storage token life cycle 36 how to check that a user has the right to create categories 40 Recursively traversing the category tree 41 Retrieve a user’s Inbox and Favorites folder IDs 43 Creating a new folder or category 45 Moving and renaming categories or folders 46 Retrieve the properties for a category 46 Displaying a document list 49 Save a Web Intelligence document 50 Scheduling a document 51 Retrieve the list of groups to which a user belongs 52 Sending a document to folders and categories 53 Send a document to the inbox of groups of users 55 Getting the name of a Web Intelligence document using REBean 58 Adding a property to a Web Intelligence document 58 Viewing all the reports in a Web Intelligence document 63 Viewing a report in a Web Intelligence document 63 Viewing a report in Microsoft Excel format 64 Handling a single. simple prompt 66 Dynamically creating input names 68 Customizing Web Intelligence 5 .

simple prompts 68 Displaying a simple list of values 70 Handling multivalued prompts 72 Handling multicolumn lists of values 72 Order of filling a hierarchy of nested prompts 74 Handling nested prompts 74 Refreshing a list of values containing nested prompts 75 Traversing the report map for a Web Intelligence document 77 Defining the query string parameters 84 Setting the drill path 86 Displaying the drilled report 88 Launching the Web Intelligence Java Report Panel 96 Building a data provider 98 Creating a simple condition 100 Structure of a complex condition 101 Including a prompt in a condition 101 Creating a blank document 104 Creating a document structure 107 Creating an attachment 109 Editing the sections of a report 109 Building a report: adding expressions to axes 112 Accessing the values in a recordset 121 6 Customizing Web Intelligence .Examples Handling many.

Customizing Web Intelligence Introduction chapter .

1 Introduction About this guide About this guide This guide describes the processes and procedures for creating web applications using BusinessObjects Enterprise SDK and the Web Intelligence Report Engine SDK REBean package. and JSP development. Who should read this guide To use the BusinessObjects Enterprise SDK and Web Intelligence Report Engine SDKs you need a working knowledge of the concepts of distributed computing systems. with links to online resources. Business Objects information resources For more information and assistance. see “Business Objects Information Resources” on page 123. Familiarity with Web Intelligence is assumed. You also need a basic knowledge of the products in the BusinessObjects product line. 8 Customizing Web Intelligence . training. HTTP server technology. customer support. and consulting services. This appendix describes the Business Objects documentation.

Customizing Web Intelligence Introduction to WebIntelligence SDK chapter .

Web Intelligence Report Engine exposes the functions of the Web Intelligence Report Engine. It provides the functions of the Web Intelligence Report Engine. BusinessObjects Enterprise SDK The "platform package. and document scheduling. Packages for customizing WebIntelligence There are four packages for customizing Web Intelligence: • • • Web Intelligence SDK You use Web Intelligence SDK to customize Web Intelligence. Typically. 10 Customizing Web Intelligence . BusinessObjects Enterprise SDK Crystal Enterprise Documents View Refresh Analyze Platform functions Manage sessions and users Manage documents and categories List universes. This chapter briefly introduces WebIntelligence SDK and the workflows a typical application needs to implement. Web Intelligence Report Engine SDK This package plugs into Business Objects Enterprise SDK.1 Overview WebIntelligence SDK consists of a number of Java packages. every application that uses these packages must implement the same kinds of workflows." provides platform functions of the Business Objects servers. documents Schedule Web Intelligence SDK Web Intelligence documents View Refresh Analyze Create† Format† Metadata (universe) Explore† BusinessObjects Enterprise SDK is called the platform package because it exposes the platform functions of the Business Objects servers.

While it is not absolutely necessary. A more sophisticated application could also include features such as document creation and report formatting. depending on the user’s rights.1 Migrating to BusinessObjects XI If you already have a business intelligence solution based on previous versions of Developer Suite you might need to migrate your solution. A typical Web Intelligence SDK application Not all applications that use Web Intelligence SDK have the same features. Migration affects the following areas: • • • • • • • referencing components of the Business Objects platform controlling user sessions listing and navigating through folders and categories managing and viewing documents handling security commands using the various dictionaries deploying your application For more information on migration issues see the Migrating Business Objects 6 Customized Applications to BusinessObjects XI guide. See “User rights for categories and folders” on page 39 and “User preferences” on page 25. every application should also take user profiles into account and ensure that errors are handled properly. and creating and managing the user’s BusinessObjects Enterprise session (login). and. Customizing Web Intelligence 11 . Document management Document management features include the ability to list the documents that the current user can view. allowing the user to browse and manage categories and folders used to organize the documents. Application essentials Every application that uses Web Intelligence SDK needs to perform a few common tasks such as importing the appropriate Java packages. but all typically provide features for listing documents in the BusinessObjects Enterprise Central Management System (CMS) and viewing documents.

Creating documents: building and editing data providers To give users the ability to create documents and generate their own reports. The Web Intelligence InfoView viewer interface has three zones: • the document tool bar. colors. and scheduling documents. and footers) and page layout of a report. Web Intelligence Report Engine SDK also includes classes for controlling the page decoration (fonts. A data provider encapsulates information about the information source and the query that defines what information is retrieved. Example workflows InfoView is implemented using BusinessObjects Enterprise SDK and Web Intelligence SDK. Using Web Intelligence Report Engine SDK you can build reports from scratch. Creating a document essentially means creating a data provider. for example Adobe® Acrobat®. You can use the same classes to provide different features for editing a query. How you provide these viewing features depends on the type of document.wid) Crystal Reports documents other document types. such as adding conditions and changing the scope of analysis. It is easy to extend this to handle reports that contain prompts. sections.1 Document management can also include features such as saving. which shows the user’s position in the document 12 Customizing Web Intelligence . The report-viewing part of the application should include routines for viewing reports in the following document types: • • • Web Intelligence (*. and cells) in the appropriate document structure. and to provide drilling functions. you need to provide them with tools to build and edit data providers. Viewing reports An application that provides a feature for viewing reports can display reports using the default HTML format. Formatting documents Formatting documents involves creating and positioning the elements of a report (blocks. These extended functions have to be handled when a document is refreshed. headers. Microsoft® Excel or XML format.

Client pages open a document check for prompts fill prompts until there are none left unfilled fill document toolbar fill report map fill rendering area Web Intelligence SDK get the report map get the report in the requested format Customizing Web Intelligence 13 . which is where reports are displayed The pages manage these zones in sequence. the prompts are filled and the position is set. which shows the structure of a report the rendering area. then the report map is populated and finally the report is rendered and displayed.1 • • the report map. Open document workflow The following diagram shows the workflow for opening a document. First the document is opened.

Client pages Web Intelligence SDK <open document workflow> update document toolbar refresh the report refresh check for prompts fill prompts until there are none left unfilled set the position fill document toolbar fill report map fill rendering area get the report map get the report in the requested format 14 Customizing Web Intelligence .1 Refresh document workflow The following diagram shows the workflow for refreshing a document.

Customizing Web Intelligence Application Essentials chapter .

and sends the details to another page which uses BusinessObjects Enterprise SDK to try to open a BusinessObjects Enterprise session. and publish them in hierarchical categories. provides log in and log out functions. You can use this as a basis for building much more sophisticated applications that provide. If the session is successfully created. get name and password from user Name = “janderson” Pass = “*******” open a session close session display “Hello World” and a logout link Table 2-1 Application for logging in and out of BusinessObjects Enterprise This application gathers login details from the user. This chapter covers the essential concepts and tasks that all applications that customize Web Intelligence must use.2 Overview Before providing viewing. “Hello World” The simplest application you can write with Web Intelligence SDK is one that creates a BusinessObjects Enterprise session. for example. such as referencing the appropriate package and creating a BusinessObjects Enterprise session for the user. When 16 Customizing Web Intelligence . view and create documents. and editing functions Web Intelligence SDK applications need to perform basic tasks. functions to list. reporting. the application displays a “Hello World” message and the option to log out. that is.

exception.plugin.crystaldecisions. com.occa. com.crystaldecisions. <% page import="com.businessobjects.plugin.CeWeb IntelligenceRightID.occa. com.destination.sdk.sdk. Referencing BusinessObjects Enterprise SDK Referencing BusinessObjects Enterprise SDK gives your web application access to the Web Intelligence platform functions exposed by the SDK. com.crystaldecisions.sdk.*.crystaldecisions.sdk. com.businessobjects. Customizing Web Intelligence 17 . com.smtp.*. import the BusinessObjects Enterprise packages.plugin.sdk.crystaldecisions.webintelligence.*.*"%> You need to include this line in every page that uses BusinessObjects Enterprise SDK.user. com. Example: Referencing BusinessObjects Enterprise SDK To import BusinessObjects Enterprise SDK packages. com. add the following line to JSP pages that use the packages.*.rebean. Note: You must use BusinessObjects Enterprise SDK prior to using Web Intelligence Report Engine SDK.destination.**. com. the application closes the user’s BusinessObjects Enterprise session with BusinessObjects Enterprise SDK and displays the first page*. Each page that uses BusinessObjects Enterprise SDK must: • • • reference BusinessObjects Enterprise SDK create or reference an IEnterpriseSession object create or reference an IInfoStore object See “Implementing “Hello World”” on page 22 for code that implements this application.plugin.sdk.crystaldecisions.sdk.*.crystaldecisions.crystaldecisions.sdk.infostore.crystaldecisions.*.2 the user clicks the logout link.*.*.crystaldecisions.framework. com. com.desktop. Referencing BusinessObjects Enterprise SDK To reference BusinessObjects Enterprise SDK.plugin.pluginmgr.infostore.server.sdk.sdk.

2 Creating an new user session In BusinessObjects Enterprise SDK the ISessionMgr lets a user to log in to the BusinessObjects Enterprise server and create a session. A user’s BusinessObjects Enterprise session provides access to the user’s details. instantiate a new ISessionMgr object. The BusinessObjects Enterprise session represents the user’s current interaction with BusinessObjects Enterprise. 18 Customizing Web Intelligence . Get the user’s login information: • • • • 2. for example. Example: Instantiating the ISessionMgr class ISessionMgr mySessionMgr = CrystalEnterprise. name password the Central Management System (CMS) the user wishes to log into authentication type (Enterprise or LDAP) Establish a valid BusinessObjects Enterprise session for the user. the list of universes that the current user can use to create documents. the values for the fields are passed via the query string to a page that processes the values. and objects that are subject to the rights of the user.getSessionMgr(). Getting login information The simplest way to get a user’s login information is to use an HTML form into which the user enters a name and a password. When the user submits the form. BusinessObjects Enterprise sessions Every user of Web Intelligence requires a BusinessObjects Enterprise session before entering and using the system. Creating a ISessionMgr object To create a ISessionMgr object for an application that uses BusinessObjects Enterprise SDK. Session information is stored in the IEnterpriseSession object returned by this method. Every session has a corresponding IEnterpriseSession object which is used to access Web Intelligence SDK. To create a session for a user: 1. You must create a BusinessObjects Enterprise session for the user: it is the key part of the log in and authentication process.

jsp in the query string parameters Name and Pass.2 Example: HTML form for gathering a user’s login information <FORM name="LoginForm" action="Login. Since the method attribute of the form is set to POST. Customizing Web Intelligence 19 .jsp" method="POST"> <TABLE><TR> <TD>Name:</TD> <TD><input name="Name"></TD> </TR> <TR> <TD>Password:</TD> <TD><input type="password" name="pass"></TD> </TR> <TR> <TD>Central Management System:</TD> <TD><input name="CMS"></TD> </TR> <TR> <TD>Authentication:</TD> <TD> <select name='auth'> <option value='secEnterprise'>Enterprise</ option> <option value='secLDAP'>LDAP</option> </select> </TD> </TR> <TR> <TD><input id=submit1 name=submit1 type=submit value="Login"></TD> </TR></TABLE> </FORM> Note: When the user enters login information and clicks the Login button. Authentication The way you monitor passwords depends on how BusinessObjects Enterprise passwords have been set up by the BusinessObjects Enterprise system administrator. these values will not be visible in the URL. the values for the fields are passed to Login. There are two settings available to the system administrator which you can use as the basis for the login procedure in your own application: • Enterprise Mode This mode requires from the user to submit a user name and password which are unique to BusinessObjects Enterprise (and may be different from their network name/password combination).

you can retrieve it from the user’s session attributes. If the IEnterpriseSession object is valid. enterpriseSession). ISessionMgr mySessionMgr = CrystalEnterprise. Establishing a valid BusinessObjects Enterprise user’s session To establish a valid BusinessObjects Enterprise user’s session: 1. iStore). Example: Establishing a session The following code fragment illustrates how to establish a BusinessObjects Enterprise session using J2EE. IInfoStore iStore = (IInfoStore) enterpriseSession.logoff. 2. try { eSession = mySessionMgr.2 • LDAP Mode This mode requires the user to submit a user name and password which are stored on a corporate LDAP server. These steps are usually done together and are normally followed by redirecting the user to an appropriate page: a welcome page or back to the login page.getService("InfoStore"). Closing a BusinessObjects Enterprise session To close a session. Try to create an IEnterpriseSession object for the user. auth).setAttribute("EnterpriseSession". use IEnterpriseSession. if (eSession != null){ session. CMS. IEnterpriseSession eSession.logon(name. For more information on authentication in Windows. log a user out of BusinessObjects Enterprise. store this object in the user’s session attributes. see the BusinessObjects Enterprise XI Administrator’s Guide. session. password. 3. Create an IInfoStore object and store in the user’s session attributes. that is.setAttribute("InfoStore". depending on the validity of the session. 20 Customizing Web Intelligence .getSessionMgr(). } Retrieving a BusinessObjects Enterprise session Once you have established a valid BusinessObjects Enterprise session for the user. } catch (SDKException sdkEx){ .

Note: See “logout.jsp” on page 24 for an example of how to close a BusinessObjects Enterprise session. This will degrade server performance. Customizing Web Intelligence 21 . BusinessObjects Enterprise session time-out BusinessObjects Enterprise sessions have a time-out value which determines the number of seconds users can be inactive before their sessions are automatically closed. The BusinessObjects system administrator sets the time-out.2 Closing a session is important: • • It frees the resources held by the user’s BusinessObjects Enterprise session. It forces other users to start their own sessions rather than just taking over an existing session. Session objects created on the BusinessObjects Enterprise server will not be liberated correctly. Note: If the session time-out of the application server hosting the web application is less than the BusinessObjects Enterprise session time-out: • • The user’s JSP page will not have access to objects such as IInfoStore stored in the user’s application server session variables.

jsp <html> <body> <h1>Create a BusinessObjects Enterprise Session</h1> <form name="LoginForm" action="login.jsp" method="POST"> <table><tr> <td>Name: </td> <td><input name="Name"></td> </tr> <tr> <td>Password: </td> <td><input type="password" name="Pass"></td> </tr> <TR> <TD>Crystal Management System:</TD> 22 Customizing Web Intelligence . see the Installation and Configuration Guide for Windows or UNIX.jsp.jsp displays a form which collects the user’s login information which is passed to login.jsp attempts to create a session and IInfoObject for the user. index. To run this application you need to have installed BusinessObjects Enterprise and established a Business Objects Central Management System. When the user clicks the logout link.jsp Name = “janderson” Pass = “********” login.jsp redirects to home. Login.jsp home.jsp closes the session and displays index.2 Implementing “Hello World” Following is an implementation of the Hello World application discussed on page 16.jsp again.html which displays the “Hello World” message and a link to logout. logout.jsp logout. For more information. index.jsp.html In this implementation index. login. If the operation is successful.

jsp This page is opened when the user clicks Login in the form LoginForm described on page 19.framework.getSessionMgr().crystaldecisions.ISessionMgr" %> <%@ page import="com.CrystalEnterp rise" %> <%@ page import="com. userID == null) userID = "".businessobjects. auth == null) auth = "".sdk. if if if if ( ( ( ( CMS == null) CMS = "".rebean.crystaldecisions.wi. Customizing Web Intelligence 23 .IEnterpriseSe ssion" %> <%@ page import="com.sdk.getParameter("pass").*" %> <% String CMS = request.2 <TD><input name="CMS"></TD> </TR> <TR> <TD>Authentication:</TD> <TD> <select name='auth'> <option value='secEnterprise'>Enterprise</ option> <option value='secLDAP'>LDAP</option> </select> </TD> </TR> <tr> <td><input id=s1 name=s1 type=submit value="Login"></ td> </tr></table> </form> </body> </html> login.getParameter("Name"). String userID = request.exception.framework.getParameter("CMS").crystaldecisions.SDKException" %> <%@ page import="com. <%@ page import="com.sdk.crystaldecisions.getParameter("auth"). String password = request. password == null) password = "". String auth = request. try { ISessionMgr mySessionMgr = CrystalEnterprise. IEnterpriseSession enterpriseSession.sdk. The user name and password used for the login are passed from the HTML form in the query string parameters Name and Pass.framework.

enterpriseSession = null.jsp"). session. enterpriseSession =(IEnterpriseSession) session.setAttribute("InfoStore". password. } else response.sendRedirect("index. } home. IInfoStore iStore = (IInfoStore) enterpriseSession.jsp">Log out</a> </body> </html> logout.logon(userID.sdk.logoff(). %> } catch( SDKException mySDKExept) { response. session. session.sendRedirect("home.auth).html").removeAttribute("EnterpriseSession").sendRedirect("index.crystaldecisions.getAttribute("EnterpriseSession").jsp <%@ page import="com.2 enterpriseSession = mySessionMgr. iStore).IEnterpriseSe ssion" %> <% IEnterpriseSession enterpriseSession.getService("InfoStore").jsp"). CMS.setAttribute("EnterpriseSession". if (enterpriseSession != null) {//Create and store useful objects for the session. enterpriseSession). } %> 24 Customizing Web Intelligence .html <html> <body> <h1>Create a Web Intelligence Session: Home Page</h1> <p>Hello World!</p> <a href="logout. if(enterpriseSession != null) { enterpriseSession. response.framework.

For example. Accessing Web Intelligence user preferences With BusinessObjects Enterprise SDK you can get. if the user wants to use the Java version of the Report Panel for creating and editing documents then you need to design your application so that it can display the Java Report Panel rather than the HTML Report Panel. values and meaning. When designing a Web Intelligence SDK application you should take this into account. (default) webi_panel java html DOCUMENT_WIStartNewDrill duplicate existing Customizing Web Intelligence 25 . Start the drill action in a duplicate report.2 User preferences Users can set their InfoView and Web Intelligence Report Engine viewing options using the Preferences page. Standard preferences and possible settings are: Web Intelligence standard user preference variables. View Documents in Interactive format. View Documents in HTML format. Variable Name webi_view Possible Values P I H Meaning View documents in PDF format. (default) Create documents using the HTML Report Panel. (default) Create documents using the Java Report Panel. Start the Drill action in the current report. set and add new preferences in a user’s profile.

(default) Do not Synchronize Drill on report blocks. SI_NAME. Hide the Drill bar. 3. String sQuery = "SELECT SI_ID. Get the "desktopsettings" profile string. (default) Do not prompt if Drill requires additional data. int uId){ String prefs = "".iterator(). Convert the profile string to a Map for easy manipulation and printing. <%! //Return a string containing a user’s Web Intelligence Preferences String getWebiPrefs(IInfoStore iStore. 26 Customizing Web Intelligence . Show the Drill bar. Get the current user’s IUser object using an IInfoStore query. Example: Printing a user’s preferences The following JSP code functions show how to retrieve a user’s Web Intelligence preferences and print them to an HTML response stream. (default) DOCUMENT_WIPromptDrillOutScope N Y DOCUMENT_WISyncDrillBlocks N Y DOCUMENT_WIDrillBar N Y Note: other applications may have their own user settings which are stored in the user if (users. For more information see “Adding custom options to a user’s profile” on page 29. Synchronize Drill on report blocks. IInfoObjects users = null.2 Variable Name Possible Values Meaning Prompt if drill requires additional data. SI_DATA FROM” + “ CI_SYSTEMOBJECTS WHERE SI_ID = '" + uId + "'". try{ users = iStore.size() > 0){ IUser user = (IUser)users. Getting a user’s Web Intelligence preferences To read the value of a user’s option: 1. 2.

<% int userID = myIEnterpriseSession. } } %> Customizing Web Intelligence 27 . PrintWriter myWriter = response. st2. if (prefsMap != null){ Iterator itr = prefsMap. "&").getWriter(). } %> The following code fragment shows how to use the functions declared above to print a user’s Web Intelligence preferences to an HTML stream.getUserID().2 prefs = user. } }catch(SDKException sEx){ return ““. } return prefs.nextToken(). } return webiPrefs.put(st2. Map webiPrefs = null.Entry current = (Map. } //Convert a String of preferences to a Map Map webiPrefsToMap(String prefs){ StringTokenizer st = new StringTokenizer (prefs.getKey() + "=" + current.nextToken().countTokens() == 2) webiPrefs. StringTokenizer st2 = new StringTokenizer (s2.hasNext()) { Map. String prefs = getWebiPrefs(myIInfoStore.getUserInfo(). userID). myWriter. while(itr.getValue() + "<br>"). "=").hasMoreTokens()) { String s2 = st.iterator(). Map prefsMap = webiPrefsToMap(prefs).print ( while (st.entrySet(). if (st2.getProfileString("desktopsettings").

commit(users).hasNext()) { Map.query(sQuery). try{ users = iStore. 3. SI_NAME. iStore.2 Setting an option in a user profile To set an option: 1.getKey()).Entry)itr. 2. Convert the Map to a String. user. void setWebiPrefs(IInfoStore iStore. sbWebiPrefs. Update a standard option in the Map continuing the user preferences. prefs). } %> } return sbWebiPrefs. <% //Update a user’s Web Intelligence preferences 28 Customizing Web Intelligence . } } //Convert a preferences Map to a string String webiPrefsToSting(Map wPrefs){ StringBuffer sbWebiPrefs = new StringBuffer().entrySet().next().length() != 0) sbWebiPrefs.append("&").append(current.Entry current = (Map. The following code fragment shows how to use the functions declared above to update a user’s Web Intelligence preferences. SI_DATA FROM CI_SYSTEMOBJECTS WHERE SI_ID = '" + uId + "'".iterator(). IInfoObjects users = null.size() > 0){ IUser user = (IUser)users. String prefs. sbWebiPrefs. while(itr. 4.iterator(). Iterator itr = wPrefs. } }catch(SDKException sEx){ .append(current. Example: Setting a user’s report panel preference to Java The following JSP code functions enables a user’s profile to be updated to use the Java Report Panel. <%! //Update the user’s Web Intelligence preferences. sbWebiPrefs. int uId) { String sQuery = "SELECT SI_ID.setProfileString("desktopsettings". if(sbWebiPrefs. Update the user profile with IInfoStore.append("=").next(). if (users.getValue()).commit.toString(). Get a user’s preferences.

setWebiPrefs(iStore. %> Note: The functions getWebiPrefs and webiPrefsToMap are declared in the example “Printing a user’s preferences” on page 26 Adding custom options to a user’s profile To add custom options to a user’s profile: 1.getUserInfo(). Update the user profile with IInfoStore.2 int userID = myIEnterpriseSession. String prefs = getWebiPrefs(myIInfoStore. userID). <% //Add a custom Web Intelligence preference using functions defined in the previous examples int userID = myIEnterpriseSession. "java"). webiPrefsToSting(prefsMap). %> Note: The functions getWebiPrefs and webiPrefsToMap are declared in the example “Printing a user’s preferences” on page 26. 3. userID). Map. Set the custom option with Map. Example: Adding a new preference to a user’s profile The following JSP code fragment sets a custom preference. Get a user’s preferences. Map prefsMap = webiPrefsToMap(prefs). Customizing Web Intelligence 29 .getUserInfo(). prefsMap. When you set an option that does not exist in the user profile.put( "webi_panel".put creates a new option and sets it to the value you specify. String prefs = getWebiPrefs(myIInfoStore. webiPrefsToSting(prefsMap). Map prefsMap = webiPrefsToMap(prefs). userID). userID). 2. Convert the Map to a String.getUserID(). prefsMap. 4.put. "tea").commit. setWebiPrefs(iStore.getUserID().put( "MyPreference".

30 Customizing Web Intelligence . Note: All exception classes (above) are subclasses of the REException class.2 Exception handling BusinessObjects Enterprise SDK generates exceptions of the type SDKException. Web Intelligence Report Engine SDK generates exceptions of the following type: • • • • • • • • • REException CommunicationException ConfigurationException FilterConditionException InvalidParameterException QueryException ReportException ServerException UserInputRequiredException Exceptions and their descriptions are listed in the online reference documentation. Depending on the cause of the exception.

webiRepEngine).rebean. Example: Instantiating a ReportEngine object To instantiate the ReportEngine object. retrieve the ReportEngine object from the user’s IEnterpriseSession. add the following line to JSP pages that use REBean. add the following lines to one page of the web application that uses the reporting features of the Web Intelligence SDK."WebiReportEngine").getLanguage()). Referencing Web Intelligence Report Engine SDK Referencing the Web Intelligence Report Engine packages gives your web application access to the Web Intelligence functions exposed by REBean.setAttribute("ReportEngine". Example: Importing the REBean package To import the REBean package.getLocale(). Customizing Web Intelligence 31 . session. <%@ page import= "com. edit and format Web Intelligence documents. If the web application uses J2EE it must reference REBean.2 Reporting essentials All applications that view.businessobjects.wi. ReportEngine webiRepEngine = (ReportEngine) enterpriseSession.setLocale(request. edit or format Web Intelligence documents need to: • • • reference Web Intelligence Report Engine SDK initialize the ReportEngine object This links the report engine and platform packages.*" %> Note: You need to include this line in every JSP page that uses REBean classes.getService("". close the ReportEngine object Note: You use Web Intelligence Report Engine to view. Note: Business Objects recommends that this object is created when the user logs in to the BusinessObjects Enterprise server. webiRepEngine. Creating a ReportEngine object with REBean To create a ReportEngine object for an application that uses Web Intelligence Report Engine SDK.

You need to include this on every JSP page that uses the ReportEngine object. ReportEngine webiRepEngine = (ReportEngine) session.close().getAttribute("ReportEngine"). Closing a report engine object Just as you need to close a BusinessObjects Enterprise session. there can be several ReportEngine objects existing at the same time. This method deallocates the memory assigned to the object and should be called before you call IEnterpriseSession.logoff(). you should also close a report engine object when you have finished with it. Since the scope is set to session. 32 Customizing Web Intelligence . The ReportEngine object is recuperated in further JSP scripts using the following code. To close a report engine object use ReportEngine.2 Note: The locale used by the ReportEngine must match the locale used by the client browser.

Customizing Web Intelligence Document Management chapter .

for example Microsoft Excel (. and depending on the user’s rights.pdf) files Using Web Intelligence SDK you can do everything Web Intelligence users can do with Web Intelligence documents: • • • • • • • • • • • • view as HTML view as PDF view as Excel view as XML refresh create categorize delete drill save schedule send 34 Customizing Web Intelligence . allowing the user to browse and manage categories and folders used to organize the documents. Document types With BusinessObjects Enterprise SDK you can work with: • • • Web Intelligence documents Crystal Reports documents third-party documents. This chapter explains how to open. and Adobe Acrobat (. list.xls).3 Overview Two key parts of a typical Web Intelligence SDK application are listing the documents that the user can view. and work with documents.

Web Intelligence creates a DocumentInstance object that has a storage token. Temporary files Executing file doc object open doc StorageToken = r0 r0 view1 As the document changes state through the execution of JSP files. are created.getResult calling DataProvider. Web Intelligence also creates some temporary files that contain information about the document’s current state. Storage token life cycle Web Intelligence generates a storage token: • • when you open a document when the microcube contents are modified or formatted When you open a document.3 Document state: storage tokens Storage tokens are a way to save and. Web Intelligence generates a new storage token and corresponding set of temporary files at the following triggers: User interface Triggers refreshing the document drilling creating and editing a document applying new formats running a query SDK Triggers calling DocumentInstance. representing the document’s states.runQuery opening a document Customizing Web Intelligence 35 . and more temporary files. the storage token changes too.getView modifying the DrillPath object calling DataProvider. later. reconstruct the state of a document.

getView. a new storage token is generated when you commit the change using DocumentInstance. this call name is shortened to “get doc”. In the diagram below.3 Note: Setting a password and filling in a prompt does not cause a new token to be generated directly. It also shows how the storage tokens are passed between web pages and refer to temporary files that can be used to reconstruct the DocumentInstance object using the call ReportEngine. Using the storage token as an identifier for a document state. However. 36 Customizing Web Intelligence .getDocumentFromStoratagetoken. you can restore the document to any of its saved states. Example: Storage token life cycle The following diagram shows how storage tokens change according to triggers in the user interface and the object model.

3 e. Temporary files 1 Executing files docInstance object open docInstance StorageToken = r0 r0 GIF run query StorageToken = r0-s0 r0-s0 view1 r0-s0 2 GIF GIF get doc(r0-s0) drill StorageToken = r0-s1 r0-s1 view2 r0-s1 3 get doc(r0-s1) GIF drill StorageToken = r0-s2 r0-s2 GIF commit change StorageToken = r0-s3 view3 r0-s3 Customizing Web Intelligence 37 .

users can go back and forwards in their browser to a previous document state and continue working from that state. 38 Customizing Web Intelligence . This means that storage tokens are purged from the disk only when the user logs out and the corresponding BusinessObjects Enterprise session ends. Note: Storage tokens are linked to ReportEngine instances.3 Table 3-1 Storage token life cycle Advantages of storage tokens Lifetime A storage token in the file system lasts as long as its BusinessObjects Enterprise session. It is not possible to open a document using a storage token created by a different ReportEngine instance. Browser navigation back and forward After progressing through several document states.

can set how much control a user or group has over categories and folders. The following table lists an InfoView user’s possible rights. a user can save a document to selected categories and folders.3 Organizing documents in categories and folders In Web Intelligence. rename and delete categories and folders get the details of a categories and folders User rights for categories and folders A System administrator. These in turn enable you to: • • create. using BusinessObjects Enterprise Central Management Console. Documents that are organized in the hierarchical category and folder structures are easier to find for users who need to search for them. categories and folders are used to classify documents in the central management system. In Web Intelligence. A document can be assigned to one or more public or personal categories. Customizing Web Intelligence 39 . Table 3-2 Categorized documents. Using the BusinessObjects Enterprise query mechanism you can navigate a category or folder hierarchy and retrieve IInfoObjects containing the individual categories and folders. User rights settings are updated in the Advanced Rights page of the InfoView section for BusinessObjects Enterprise Applications of the Central Management Console.

size() > 0) infoView = (IInfoObject )appObjects. Example: how to check that a user has the right to create categories This code fragment shows how to validate a user has the right to create categories. if (infoView != null){ 40 Customizing Web Intelligence .VIEWINBOX User can assign categories to CeInfoViewRightID.SENDDOCUMENTS CeInfoViewRightID.ADVANCEDSEARCH Can use InfoView filter feature CeInfoViewRightID. IInfoObject infoView = null.ORGANIZE User can change preferences CeInfoViewRightID. if (appObjects. try{ IInfoObjects appObjects = iStore.CREATEDASHBOARDS CeInfoViewRightID.FAVORITES CeInfoViewRightID. create shortcuts and add object to the favorites folder. <% IInfoStore iStore = (IInfoStore)session.CREATEFOLDERS A list of a user’s rights over an object in the InfoStore can be recovered by retrieving the user’s ISecurityInfo object for a certain BusinessObjects Enterprise application.get(0).SIMPLESEARCH CeInfoViewRightID.ASSIGNCATEGORIES users or groups User can send documents to users and groups User can create dashboards User can create folders CeInfoViewRightID.CREATECATEGORIES User can view inbox contents CeInfoViewRightID. String query = "SELECT STATIC FROM CI_APPOBJECTS.” + “ CI_SYSTEMOBJECTS WHERE” + “ (SI_PARENTID = 99 AND SI_KIND=\'" + CeKind.query( query).PREFERENCE CeInfoViewRightID.INFOVIEW + "\')".getAttribute("InfoStore").FILTER CeInfoViewRightID. Can use InfoView simple search Can use InfoView advanced search User has a favorites folder User can create categories Variable Name CeInfoViewRightID.3 Folder and category-related settings in a Web Intelligence user’s rights InfoView Advanced Right User can move and copy objects.

Customizing Web Intelligence 41 . check that the user who started the session has the appropriate rights..size() > 0) FolderID= ((IInfoObject)folders. int userID. To access the category or folder trees. Use this ID to navigate the child nodes.. query the repository to retrieve the ID of the parent node for categories or folders.INFOVIEW. String kind){ int FolderID = 0. Example: Recursively traversing the category tree The following example shows JSP functions that use BusinessObjects Enterprise SDK to recover the ID of the parent folder for a user’s personal categories..query(query). Note: A list of a rights for other BusinessObjects Enterprise applications can be found by changing the CeKind being searched for. For example. } %> Note: Before trying to manage categories. to search for a user’s Web Intelligence rights the query string would include CeKind.. Navigating categories and folders Categories and folders in a Web Intelligence Central Management System are represented as a tree. <%! //Return the ID of a specific folder public int getFolderParentId(IInfoStore iStore. if (secInfo.getParentID(). Using this ID a bulleted list containing the hierarchical structure of the user’s personal categories is generated. try{ folders = iStore.checkCustomRight( CeInfoViewRightID. IInfoObjects folders = null. if(folders. String query = "SELECT SI_PARENTID FROM CI_INFOOBJECTS” + “ WHERE SI_KIND='" + kind + "'" + “ AND SI_OWNERID=" + userID.get(0)). infoView. } } }catch (Exception exc){ .3 ISecurityInfo secInfo = infoView. Home is the root node for folders. Personal and Public are root nodes for categories.WEBINTELLIGENCE in the place of CeKind.getKind())) { .getSecurityInfo().CREATECATEGORIES.

getID().getAttribute("InfoStore"). String kind ){ String results = "". SI_NAME. <% IEnterpriseSession enterpriseSession =(IEnterpriseSession) session. i < categories. int userID = enterpriseSession.isEmpty()){ results += "<ul>".3 } //Return a selectable list of categories or folders String getCategoryList(IInfoStore iStore. String sQuery = "SELECT SI_ID.size().PERSONALCAT). IInfoStore iStore= (IInfoStore)session. int catID = category.get(i). if (!categories. String name = category. for(int i = 0. (String)CeKind. if (id == -1) id = 0. } results += "</ul>". kind).query(sQuery). see “Displaying a document list” on page 49.getID() . } }catch (SDKException sdke){ results = null.userID.getUserID(). %> Note: For an example of how to list documents in a folder. IInfoObject category. } return results. The following code fragment shows how to use the functions declared above to print personal categories for a user.getUserInfo(). results += "<li><input type=\"radio\" name=\"" + kind + "\" value=\"" + catID + "\" >" + name + "</li>\n". i++){ category = (IInfoObject)categories. int id. int persoCatsfolderID = getFolderParentId( iStore.(String)CeKind. category. } %> }catch (SDKException sdke){ return FolderID. results += getCategoryList(iStore.} return FolderID. 42 Customizing Web Intelligence .PERSONALCAT)). String catButtons = getCategoryList( iStore.getTitle().getAttribute("EnterpriseSession"). try{ IInfoObjects categories = iStore. SI_PARENTID FROM” + “ CI_INFOOBJECTS WHERE SI_PARENTID=" + id + " AND SI_KIND= \'"+ kind + "\'" .

Once the root directory ID is retrieved. if(folders.get(0)).size() > 0) FolderID = ((IInfoObject)folders. } return FolderID. <% IEnterpriseSession enterpriseSession. enterpriseSession = (IEnterpriseSession) session. int userID.(String)CeKind.3 Retrieving Inbox and favorites folder IDs Each BusinessObjects Enterprise user has unique personal directories. } //Retrieve the ID of a user’s Inbox int getInboxFolderId(IInfoStore iStore.INBOX). you can list and navigate the contents in the same way corporate folders are navigated. <%! //Retrieve the ID for any type of personal folder public int getFolderId(IInfoStore iStore.FAVORITESF).userID. try{ folders = iStore. int userID){ return getFolderId(iStore.getAttribute("EnterpriseSession").getID().userID. int userID){ return getFolderId(iStore.(String)CeKind. IInfoStore iStore = (IInfoStore) Customizing Web Intelligence 43 . }catch(SDKException sdke){ FolderID = -1. } //Retrieve the ID of a user’s favorites folder int getFavoritesPFolderID(IInfoStore iStore. String kind){ int FolderID = 0. Example: Retrieve a user’s Inbox and Favorites folder IDs The following example shows JSP functions that use BusinessObjects Enterprise SDK to recover the ID of the parent folder for a user’s Inbox and Favorites folders. IInfoObjects docList = null.query(query). IInfoObjects folders = null. String query = "SELECT SI_ID" + " FROM CI_INFOOBJECTS" + " WHERE SI_KIND='" + kind + "'" + " AND SI_OWNERID=" + userID. } %> //The following example shows how to retrieve a list of documents in the current user’s Inbox. See “Displaying a document list” on page 49 for the definition of getList. To list the contents of these folders you need to retrieve the ID for each user’s personal directories. The Inbox and Favorites directories contain documents sent to a specific user or saved for personal rather than corporate use.

getAttribute("InfoStore").getUserID(). inboxID.getUserInfo(). docList = getList(iStore. int inboxID = getInboxFolderId(iStore.3 session. int userID = enterpriseSession. %> Note: See “Displaying a document list” on page 49 for the definition of getList. 44 Customizing Web Intelligence .WEBI ). userID). (String)CeKind.

PERSONALCAT). newInfoObjects. %> Customizing Web Intelligence 45 . int parentFolderID. } return objectID. IInfoObjects newInfoObjects = iStore.commit (newInfoObjects).3 Creating categories and folders You can add categories and folders by: • • • getting the ID of the folder or category in which you wish to create a node getting the correct plug-in to create a node committing the new object to the Central Management System Example: Creating a new folder or category The following example shows JSP functions that use BusinessObjects Enterprise SDK to create a new folder or category.getID().setDescription (description). IPluginInfo plugin.get(0).add(plugin).newInfoObjectCollection(). IInfoObject infoObject = (IInfoObject) newInfoObjects.CeKind. iStore. "Category Name". infoObject. categoryParentID. "Keywords".properties(). String description.getPluginInfo(type). CeKind. infoObject. objectID = infoObject. "Folder Name"."). parentFolderID).String name. //Create a new personal folder addFolderOrCategory(iStore. infoObject.getPluginMgr(). try{ IPluginMgr pluginMgr = iStore. }catch (SDKException e) { throw new Error("Failed to add the object. } %> The following code fragment shows how to use the functions declared above to create a new personal category and a new folder.FOLDERS). "Keywords". <%//How to use this function //Create a new personal category addFolderOrCategory(iStore. <%! int addFolderOrCategory(IInfoStore iStore. categoryParentID.setProperty( CePropertyID. plugin = pluginMgr. String type){ int objectID = 0.setTitle (name).SI_PARENTID.

3 Moving and renaming categories and folders You can move categories and folders from one parent to another with: • • IInfoObject. IInfoObjects result. currResult. <%! String changeNameMove(IInfoStore iStore. } return res. Example: Retrieve the properties for a category The following method returns the properties of a category.query(query).setParentID myIInfoObject. folder. SI_ID From CI_INFOOBJECTS “ + “ Where SI_ID=" + ID. String newName. String res = "". try{ result = iStore.setParentID(newParentID). query = "Select SI_NAME.setTitle You can rename categories and folders using: After the category or folder has been renamed or moved.setTitle(newName). request SI_NAME. currResult = (IInfoObject)result. int newParentID){ String query.commit must be called with the changed IInfoObject passed as a parameter." To retrieve an IInfoObject's details.get(0). SI_KEYWORD in the query string used to recuperate the IInfoObject representing a category or folder. known as a "properties bag. int ID.commit(result). IInfoStore. currResult. or document as an IInfoObject: 46 Customizing Web Intelligence . Example: Moving and renaming categories or folders The following function changes the name of a folder or category and moves it in the folder or category hierarchy respectively. } %> Getting the properties of a category Each IInfoObject in the BusinessObjects Enterprise InfoStore contains a collection of all properties assigned to that object. SI_DESCRIPTION. if ( result. } } catch(SDKException e){ .size() > 0 ){ IInfoObject currResult. iStore.

IInfoStore iStore = (IInfoStore) session. IInfoObjects result = null.print( fProperties. <% int ID = Integer. int ID){ String query. } return properties. String res = "". %> Customizing Web Intelligence 47 . query += " FROM CI_INFOOBJECTS WHERE SI_ID=" + ID.get(0).getValue(). ID).query(query). IInfoObject fProperties = getProps(iStore. myWriter.print( fProperties. if (result.getDescription() + "<br>\n"). myWriter. IInfoObject properties = null. } %> The following code fragment shows how to use the functions declared above to print the description and keywords of an InfoStore object to an HTTP stream.” + ” SI_KEYWORD. //Another way to retrieve the keyword IInfoObject Property myWriter. query = "SELECT SI_FILES.toString()).getWriter().getKeyword() + "<br>\n"). PrintWriter myWriter = response.3 <%! IInfoObject getProps(IInfoStore SI_KIND". try{ result = iStore.parseInt(request.getParameter("ID")).SI_KEYWORD).size() > 0){ properties = (IInfoObject)result.getAttribute("InfoStore").getProperty( CePropertyID.print( fProperties. } } catch(SDKException e){ return null. SI_DESCRIPTION.

the maximum number of DocumentInstances open concurrently on one application server is ten.openDocument method for Web Intelligence documents. to open a document you: 1. Get an identifier for the document. which are set in the BusinessObjects Enterprise Central Management Console. Open the document using the ReportEngine. Establish a BusinessObjects Enterprise session for the user. 2. The identifier can be a storage token (see “Document state: storage tokens” on page 35). When the number of DocumentInstances exceeds the default. You should also take into account the settings in the user’s profile. or more simply the document’s ID. what your application can do with the document is subject to the user’s rights. then providing facilities for saving. See “User preferences” on page 25. and organizing documents. If you want to change the default value. 3. 48 Customizing Web Intelligence . Loop through the IInfoObject list and print the values of the fields of each row. Note: By default. Displaying document lists To display a list of documents you: 1.query method to return the list of IInfoObjects representing the root directory of the user’s folders and documents. Allow navigation through the folders. sending. 3. set the variable FAILOVER_SIZE to the value desired in the webi. Taking into account user rights and profiles Because your Web Intelligence application acts on behalf of a user.3 Working with documents Working with documents involves opening and listing the documents. Use the IInfoStore. 2. You should take these rights into account in your application. the primary application server will failover to a backup application server. Opening documents After establishing a session for a user (see “Establishing a valid BusinessObjects Enterprise user’s session” on page 20) you can open a document on behalf of the user. In general. file of your BusinessObjects Enterprise installation.

(String)CeKind. This function is placed either at the head of the listfolders.jsp script or in a file containing helper functions included in listfolders. An IInfoObject can be used to store any type of object in the central management system.getParameter("sID"). <% int iID= 0.jsp. %> Customizing Web Intelligence 49 . <%! IInfoObjects getList(IInfoStore iStore. } catch (SDKException sdke){ list = null. SI_INSTANCE.. which is then used to return a list of IInfoObjects of a required type.query(query).3 Note: IInfoObject is the base BusinessObjects Enterprise type.getAttribute("InfoStore"). int searchID.jsp. String kind){ IInfoObjects list = null. The results come directly from the BusinessObjects Enterprise Central Management System (CMS) with no intermediary cache. SI_DESCRIPTION FROM” + “ CI_INFOOBJECTS WHERE SI_PARENTID=" + searchID + " AND SI_KIND = '" + kind + "'".parseInt(searchID). String query = "SELECT SI_ID. SI_PARENTID. //ID of the root folder IInfoObjects webiDocs = null. } %> The function getInfoList is called from listfolders.” + “ SI_KIND. Example: Displaying a document list The following JSP code fragment is a helper function called getList.iID.query is called. The following code fragment shows returns a list of Web Intelligence documents in the document root folder. try{ list = iStore. This function is passed an IInfoStore object as a parameter. SI_NAME. webiDocs=getList(iStore.. Refreshing a document list A document list is refreshed every time IInfoStore. if (searchID!=null) iID=Integer. . in this case Folders or Web Intelligence documents. } return list. IInfoStore iStore = (IInfoStore)session. String searchID=request.WEBI).

Scheduling documents Scheduling refreshes a document automatically at a specified time or times. 50 Customizing Web Intelligence . an instance is created. Instances created later contain more recent data. and distributing. a user can have the latest information available for viewing.saveAs. printing. %> Note: Go to “Sending documents to users.openDocument(docID). Query the IInfoStore to get the IInfoObject representing the specific document. This means that Prompt. 4. 3. //User perform actions on document doc. 2. Set the type and frequency of the scheduling.. and Drill actions have to be handled automatically at run time using information gathered from the user when the schedule action is created. docToSave. By scheduling and viewing instances.. //Open the first version of the document and save. Context. Use the IInfoStore to schedule the document. For example.getStorageToken(). Get the document IInfoObject’s ISchedulingInfo object.openDocument(docToken).save and DocumentInstance. Example: Save a Web Intelligence document The following example shows how to open a document to be worked on. groups and categories” on page 52 to see how to use the saveAs <% DocumentInstance doc = myReportEngine.3 Saving documents To save a document use DocumentInstance. An instance is version of the document containing data available at the time it is refreshed. String docToken doc. Note: The schedule action refreshes data in a document. To schedule a document you need to: 1. DocumentInstance docToSave = myReportEngine. then open and save the original version of the document. When a scheduled document refreshes successfully. you can schedule a document to run every night so data viewed first thing in the morning is sure to be up to date.

get(0). } else { schedulingInfo.ONCE). <% String docId = request.parseInt(docId).getAttribute("InfoStore"). String res = "".query( schedQuery).size() > 0 ){ document= (IInfoObject) documentList. scheduleDocument(iStore.schedule(documentList).setType(CeScheduleType. schedulingInfo.3 Example: Scheduling a document The following JSP function shows how to schedule a document to run once immediately or recurrently on a specific interval of days. <%! boolean scheduleDocument(IInfoStore iStore. IInfoStore iStore = (IInfoStore)session. } return success. int days){ IInfoObjects documentList. } iStore. } %> The following code fragment shows how to call the scheduleDocument function to schedule a document to be run once immediately. } } catch( SDKException e ) { success = false . try { String schedQuery = "Select SI_schedulingInfo From” + “ CI_INFOOBJECTS Where SI_ID=" + documentID. boolean success = true. if ( documentList. ISchedulingInfo schedulingInfo. The document instance created is stored in the list of document instances attached to a document. schedulingInfo.getParameter("docID"). schedulingInfo = document. documentList = iStore. IInfoObject document. if (days == -1){ schedulingInfo.setType( CeScheduleType.DAILY ).setIntervalDays(days). Integer.setRightNow(true). -1).getSchedulingInfo(). %> Customizing Web Intelligence 51 . int documentID.

Example: Retrieve the list of groups to which a user belongs The following JSP function shows how to retrieve the list of groups the current user belongs to. 52 Customizing Web Intelligence . } catch (SDKException sdke){ groups = null.saveAs which the current user has access groups to which the IInfoStore. certain users and certain groups have the rights to different actions.USERGROUP + "'" . These permissions are controlled by the system administrator using BusinessObjects Enterprise Central Management Console. and/or the other users in those groups Save to Groups and Categories Send to Inbox. <%! IInfoObjects getUserGroups(IInfoStore iStore) { IInfoObjects groups = null. Thus. and the current user’s permissions. groups and categories The list of BusinessObjects Enterprise users to whom a document can be sent depends on the groups to which the current user belongs.3 Sending documents to users. email. } %> BusinessObjects Enterprise uses object security. String query = "SELECT SI_ID. Action To these groups and/or Depending on the current users … user’s settings for these permissions… groups and categories to DocumentInstance. SI_NAME" + " FROM CI_SYSTEMOBJECTS" + " WHERE SI_KIND='" + CeKind. try{ groups = iStore. groups. Saving a document to a specific folder and category is a way of publishing a document to a group of users. depending on the object’s settings. This means that access to folders and categories can be restricted to specific groups and individual users. FTP.schedule current user belongs. for a particular object. } return groups.query(query). which means that security is set for each object in the system and not for each user.

3 Procedure for sending a document to folders and categories BusinessObjects Enterprise documents are organized by folder and categories.jsp the user selects the folders and categories the document is to be saved in.saveAs. IInfoObjects folders = null. if(folders. you need to gather the appropriate information from the current user before sending. in the second JSP page: Example: Sending a document to folders and categories The following JSP code fragments are used to save a document in specific folders and categories.query(query). String kind){ int FolderID = 0. 1. to send a document. saveDoc. To send a document to folders use DocumentInstance.size() > 0) Customizing Web Intelligence 53 . In saveDocAs. Get the details entered by the user. Typically. 4. Note: The function getCatOrFoldersRadioButtons and webiPrefsToMap is declared in the example “Recursively traversing the category tree” on page 41. When the user clicks “Save Document” in the form. try{ folders = iStore. Then. Retrieve the IDs of: • • 3.jsp <%! //Return the ID of a specific folder public int getFolderParentId(IInfoStore iStore. String query = "SELECT SI_PARENTID FROM “ + “ CI_INFOOBJECTS WHERE SI_Kind='" + kind + "'" + AND SI_OWNERID=" + userID. Pass this information to the second JSP page. int userID. In saveDocAs. Call DocumentInstance.jsp is called by a JSP that passes the name and ID of the document in the query string. corporate folders and categories the root directory of the current user's personal categories Get and display the list of folders and categories to which the current user can send documents. 2.jsp is executed and the document is sent according to the user’s selections. however.saveAs. To do this you need two web pages: In the first page: 1. 2. saveDocAs. Display the name of the document to be sent.

String persoCatedID = request.getParentID().getParameter("persoCategory").3 } %> FolderID=((IInfoObject)folders. //Validate the parameters if (corpCategID != null) ccIDlist. Sending a document to the Inbox of users or groups If the current user has the appropriate permissions. The following code fragment shows how to use the functions declared above to create a form used to select the folders and categories in which a document will be saved.jsp <% //get the parameters from the request object String docId = request. you can schedule a document to be send to the inboxes of users or groups of users to which the current user belongs.parseInt(docId)). In saveDoc. List pcIDlist = new ArrayList().get(0)). if (persoCatedID != null) pcIDlist.getParameter("corpCategory"). }catch (SDKException sdke){ return FolderID.getParameter("docID").add(Integer. String docParentFolderID = request.getParameter("corpFolder").pcIDlist). String corpCategID = request. } %> Note: corpCategories and persoCategories are strings containing the ID’s of the corportate and personal category chosen by the active user in which to store the document.parseInt(docParentFolderID). if (docId != null && docParentFolderID != null){ //Open and save the document DocumentInstance docToSave = webiRepEngine. ccIDlist.saveAs( docName. if( docToSave != null) docToSave.} return FolderID. Procedure for sending a document to inboxes To schedule a document. you need to gather the appropriate information from the current user before sending. Integer.add(Integer.getParameter("docName"). To do this you need to: 54 Customizing Web Intelligence .decode(persoCatedID)). String docName = request.decode(corpCategID)). List ccIDlist = new ArrayList().openDocument(Integer.

String pluginString = "".get(i).equals(plugin. Schedule the document. Set the type and frequency of the scheduling.query(pluginQuery).DISKUNMANAGED. } String pluginQuery = "SELECT * FROM CI_SYSTEMOBJECTS” + “ WHERE SI_PARENTID=” + PLUGIN_ROOT + “ AND SI_NAME in " + "(" + pluginString + ")". 6. 5. Set the destination and send options for the Inbox plugin. Add the set of IDs created in the previous step to the Inbox plugin options. 7.getTitle()) ) inboxPlugin = (IDestinationPlugin)(plugin). 2. i >= 0. 8. Note: In the InfoView user interface. for (int i = pluginsToLoad. Get the document’s ISchedulingInfo object. The returned IInfoObjects object contains the ID’s of all groups the current user has the right to send to. Example: Send a document to the inbox of groups of users <%! //This function retrieves the Inbox destination plugin IDestinationPlugin getInboxDestPlugin(IInfoStore iStore){ int PLUGIN_ROOT = 29. i < destPlugins.length .3 1. this action is called “Send to BusinessObjects Inbox. CeKind. } } catch (SDKException e){ Customizing Web Intelligence 55 . i++){ IInfoObject plugin = (IInfoObject)destPlugins. 3.1. try{ IInfoObjects destPlugins = iStore. CeKind. Retrieve the Inbox plugin used to send a document to users. Allow the user to choose the users/groups to send the document to.MANAGED_DEST}. ".” You get the list of groups to which the current user can publish documents by querying the InfoStore. 4.FTP. IDestinationPlugin inboxPlugin = null.MANAGED_DEST.size(). Create a Set containing the IDs of users or groups to which the current user can send the document. Kind. for (int i = 0. if (i != 0) pluginString += ". i--){ pluginString += "'" + pluginsToLoad[i] + "'". Query the IInfoStore to get the IInfoObject representing the document to be sent.SMTP. if ( CeKind. 9. String[] pluginsToLoad = new String[] {CeKind.

IManagedOptions destOptions = null. IDestinationPlugin inboxPlugin = null. SI_KIND.USERGROUP.getDestination(). int size = groups. if ( documentList.get(i).getParameter("docID"). if (inboxPlugin != null){ destOptions =(IManagedOptions) inboxPlugin. try { String docQuery = "Select SI_schedulingInfo FROM” + “ CI_INFOOBJECTS Where SI_ID=" + docId.getScheduleOptions().query(query). } %> The following code fragment shows how to send the copy of a document to the inbox of all users in the groups the current user is allowed to post to once a week. for (int i = 0. 56 Customizing Web Intelligence .USERGROUP + "'". <% String docId = request. } return inboxPlugin. IDestination destination = schedulingInfo.get(0).getAttribute("InfoStore").getKind())) { IDs. documentList = iStore. String query = "SELECT SI_ID.size() > 0 ) { document= (IInfoObject)documentList.getSchedulingInfo().size(). ISchedulingInfo schedulingInfo = null. Set IDs = new HashSet(). IInfoObject document = null.equals(obj. //This function retrieves the IDs of the groups the current //user can schedule to Set getUserGroupIDs(IInfoStore iStore){ IInfoObjects groups = null.add(new Integer(obj.getID())).query(docQuery). schedulingInfo = document. inboxPlugin = getInboxDestPlugin(iStore). i < size. } return IDs. i++) { IInfoObject obj = (IInfoObject)groups. if (CeKind. try{ groups = iStore. IInfoObjects documentList = null. SI_NAME" + " FROM CI_SYSTEMOBJECTS" + " WHERE SI_Kind='" + CeKind.3 } inboxPlugin = null. } } } catch (SDKException sdke){ IDs = null. IInfoStore iStore = (IInfoStore)session.

3 destOptions.getDestinations(). Customizing Web Intelligence 57 .setIntervalDays(7).setSendOption( IManagedOptions.clear(). Set IDs = getUserGroupIDs(iStore). } } %> } } catch( SDKException e ) { throw e. Set destinationIDs = destOptions. schedulingInfo. destinationIDs.schedule(documentList).setDestinationOption( IManagedOptions.setType(CeScheduleType.ceInbox). schedulingInfo.CeDestinationOption.ceCopy).setFromPlugin(inboxPlugin).addAll(IDs).CeManagedSendOption.DAILY). destination. destOptions. iStore. destinationIDs.

Document properties
Some of the important characteristics of Web Intelligence documents are stored as part of the document. You can access these properties using the DocumentInstance object. For REBean the process for accessing a property of a Web Intelligence document is: 1. 2. 3. Get the collection of properties. Set/Read the property. Commit the change, if any, to the collection of properties.

Working with properties
Using Web Intelligence Report Engine SDK, you can access a document’s properties with DocumentInstance.getProperties and DocumentInstance.setProperties. These methods make use of the Java class java.util.Properties. There are predefined properties defined in PropertiesType. You can also add you own properties to the document. Note: To avoid confusion in the central management system,
PropertiesType.NAME is read only.

Example: Getting the name of a Web Intelligence document using REBean The following Java code fragment illustrates how to get the NAME property of a Web Intelligence document.
DocumentInstance doc = myReportEngine.openDocument(docID); java.util.Properties props = doc.getProperties (); String dName = props.getProperty (PropertiesType.NAME);

Adding your own properties to the document
Use Properties.setProperty to add your own properties to the document. Example: Adding a property to a Web Intelligence document The following Java code fragment illustrates how to add the RefreshCount property to a Web Intelligence document.
DocumentInstance doc = myReportEngine.openDocument(docID); java.util.Properties props = doc.getProperties (); props.setProperty ("RefreshCount", "12");

58 Customizing Web Intelligence

doc.setProperties (props);

If you create a new Properties collection and add properties to that collection, when you call DocumentInstance.setProperties the values in the new object are added to the standard property collection. Permanent properties such as NAME and AUTHOR are not erased in the merge. Values for these properties that you have set in the new collection take precedence over those in the one attached to the DocumentInstance.

Property persistence
You do not need to save the document for the properties you set to persist after the document is closed.

Customizing Web Intelligence 59


60 Customizing Web Intelligence

Customizing Web Intelligence Viewing Web Intelligence Reports chapter .

This chapter discusses how to use REBean to view Web Intelligence reports. you need to get views of each report in HTML and display those separately. For more information on storage tokens see “Document state: storage tokens” on page 35. Viewing reports You can view complete documents (all reports) in either Adobe Acrobat (PDF) or Microsoft Excel (XLS) format.4 Overview Web Intelligence SDK contains classes and methods for viewing documents. The following table shows viewing possibilities. See also and “Formatting Reports” on page 103.getView. You can get a binary view of a document in PDF or Microsoft Excel format. Note: Calling DocumentInstance.getView and Report.getView generates a new storage token. See “Viewing an individual report in HTML” on page view an individual report. call DocumentInstance.wid) handle prompts and provide report and section navigation with a report map. Applications for viewing Web Intelligence documents (*. call Report. 62 Customizing Web Intelligence . Get a binary view of the document. In Microsoft Excel format the reports of a Web Intelligence document appear on separate sheets. When Web Intelligence converts the document into PDF it places reports on separate pages and creates a bookmark for each report. Viewing all the reports in a document To view all the reports in a document: 1.getView. 2. If you want to view all the reports in a document in HTML format. Open the document. Type Document Report Report Page XLS X X X PDF X X X X X X X XML HTML To view an entire document. You can view individual reports or report pages (?) in XML and HTML format as well as PDF and XLS.

To view an individual report in HTML format: 1. //get the report contents as a binary stream in PDF format BinaryView docBinaryView = (BinaryView) doc. outputStream. byte[] abyBinaryContent = docBinaryView. Output the binary view of the document via the implicit response object.getContent(). <% // Get query string parameters and initialize variables Customizing Web Intelligence 63 .openDocument(docID). In this example. Typically these would be passed to the script in the query string. Viewing an individual report in HTML The standard viewing format is HTML. Set the report. For Microsoft Excel format.msexcel”.4 3. %> Note: This example starts Adobe Acrobat Reader® and displays the document using this application. ServletOutputStream outputStream = response. Get a view of the report in HTML format. 3. //output the binary stream via the response object response. set the content type to “application/vnd. Get a document instance.getOutputStream(). Display the report. For Adobe Acrobat format set the content type to “application/pdf”. You need to prepare the response object to receive the appropriate content type.PDF).setContentType("application/pdf"). Example: Viewing all the reports in a Web Intelligence document The following code fragment displays all the reports in a document in Adobe Acrobat format. 4.write(abyBinaryContent).getView(OutputFormatType. <% // get the document DocumentInstance doc = repEng. Example: Viewing a report in a Web Intelligence document The following JSP code fragment displays a selected report in a Web Intelligence document in HTML format. Depending on the user’s browser configuration. 2. the name of the document is stored in docName and the ID is stored in docID. the document will appear in either in the browser or in a separate application window.

To view a report in a non-HTML format: 1. Example: Viewing a report in Microsoft Excel format The following JSP code fragment displays all the reports in a Web Intelligence document in Microsoft Excel format. you must get the content of the report as a binary stream which you can output via the response object. DocumentInstance doc = null. String sRepID = request. %> <%=sHTMLView%> Note: In this example..XLS). docHtmlView = (HTMLView)rep.. // Set the report if ((sRepID != null)&&(!(sRepID.openDocument(sToken). Viewing an individual report in another format You can view reports in Adobe Acrobat or Microsoft Excel format. set the content type to “application/vnd. as for viewing all the reports in a document. For Microsoft Excel format. 2. byte[] abyBinaryContent = docBinaryView. For Adobe Acrobat format set the content type to “application/pdf”. //get a view of the report in HTML format HTMLView docHtmlView = null. String sHTMLView = docHtmlView.getParameter("token"). Report rep = null. //the report to be viewed int iRepID = 0.//set to the first report in the document rep = doc.HTML). //index of the selected report // Get the document doc = reportEngine.getContent().parseInt(sRepID). The procedure is the same as for HTML format (described above) except that.getView(OutputFormatType. else iRepID = 0.getView(OutputFormatType.equals("")))) iRepID = Integer. reportEngine is an initialized ReportEngine object. Output the binary view of the document via the implicit response object. //get the report to view (Report rep) . //output the binary stream via the response object 64 Customizing Web Intelligence .getReports(). You need to prepare the response object to receive the appropriate content”. //get the report contents as a binary stream in Excel format BinaryView docBinaryView = (BinaryView)rep.getContent().4 String sToken = request. Get a binary view of the report.getParameter("reportID").getItem(iRepID).

Customizing Web Intelligence 65 .4 response. ServletOutputStream outputStream = response.write(abyBinaryContent).getOutputStream().setContentType("application/"). outputStream.

openDocument(Token). “Enter the year: “ to which a user responds “2003” and the data retrieved by the query is restricted to the year 2003. when the prompt have been filled. ask for passwords on protected documents. simple prompt The following JSP code fragment illustrates how to handle a single. (“Simple prompt” means standard. view. In Web Intelligence Report Engine SDK. or the Customer Service table?). This section discusses how to handle prompts in Web Intelligence documents.refresh if scheduled.4 Handling prompts Prompts are a way to get supplementary information before executing a query. Prompts are usually raised when a document is refreshed using DocumentInstance. if (doRefresh) doc. Example: Handling a single.) The code in this example is from a JSP called refresh. For Web Intelligence documents you use the REBean packages to handle prompts. and resolve context clashes in universes (do you want the customer’s details to come from the Sales table.jsp is executed. //refresh first time only Prompts prompts = doc. therefore.getParameterValues("PromptInput"). if ((values != null)&&(!(values[0]. When the user chooses to refresh a document.getItem(0). Note: Prompts that resolve universe contexts must be filled before standard prompts. refresh.getPrompts(). DocumentInstance doc = reportEngine. //try to enter values and set prompts String[] values = request. For example.refresh(). simple prompt. needs to collect the supplementary information that resolves filters and contexts.equals("")))){ prompts. Prompts can resolve filters in the query. then.getMustFillPrompts()) { //build a form to get user input for the prompt 66 Customizing Web Intelligence .jsp is executed. See “Handling context prompts” on page 76. //also sets getMustFillPrompts to false } //get user input if (doc. The refresh operation executes the query and.setPrompts(). doc. text-entry prompts only. Documents with a single simple prompt One of the simplest and most common prompts is one that resolves a query filter.jsp. how you handle prompts depends on the type of document you are working with.enterValues(values).

execute view. if you use the storage token to retrieve the document.jsp? Token="+doc.jsp is executed.sendRedirect("view.setPrompts. this step will not work as the user has not yet entered a value for the prompt. Customizing Web Intelligence 67 .getStorageToken()).jsp so that this JSP is executed when the user clicks the submit (OK) button. One way to set this variable is to include an extra parameter in the query string for refresh. doRefresh is false. Note: This example does not show how to set doRefresh.refresh. when DoRefresh is ”F”. The first time refresh. • otherwise. For more information on storage tokens see “Document state: storage tokens” on page 35. The workflow for refresh. Either: • if the prompt is not filled. 2. you must be careful to use the correct token. 3.jsp.jsp?Token=<%=doc. Get the DocumentInstance object for the document.4 %> <formname="PromptsForm" action="refresh.jsp to display the document’s reports Using the storage token to retrieve a DocumentInstance When handling any kind of prompt. The storage token changes after calls to DocumentInstance.getStorageToken()%>" method="post"> <input name="PromptInput" type="text"/> <input name="Submit" type="submit" value="OK" /> </form> <% } response.jsp for a document with one. simple prompt is therefore: 1. The form’s action parameter is set to refresh. Get the collection of prompts for the document. display a form to get a value from the user This is the case the first time the JSP is executed. 4. and DocumentInstance. Try to enter values for the prompt and set the prompts for the document.

<form name="PromptsForm" action="refresh. //refresh first time only Prompts prompts = doc.getCount().getCount().refresh().openDocument(token). To do this you can construct a name using a string constant. j < prompts.jsp. when the prompt have been filled.jsp" method="post"> <table><% for (int i = 0.jsp is executed. One problem this extension raises is that you need to dynamically set the names of the inputs in the form that carry the values of each prompt. simple prompts The following code fragment illustrates how to handle many.4 Documents with many simple prompts To handle many simple prompts you can extend the workflow for the single simple prompts (page 66) with a form into which the user can enter values for all the prompts. Example: Handling many.jsp is executed.) The code in this example is from a JSP called refresh. for example “PV”.getPrompts(). then. i < prompts. simple prompts in a Web Intelligence document. When the user chooses to refresh a document. i++) { %><tr> <td>Enter a value for prompt number <%=i%>:</td> <td><input name=<%="PV"+i%> type="text"/></td> </tr><% } %><tr><td> <input name="Submit" type="submit" value="OK" /> </tr></td> </table> </form> Note: See the following example for an illustration of how to retrieve the values in these inputs from the query string. <% //get the document and its prompts DocumentInstance doc = reportEngine. view.getParameterValues(("PV" + j)). and a script that handles these values. (“Simple prompt” means standard. //try to get and enter values from the query string // valuesSelected is true when the user completes the form if (valuesSelected) { for (int j = 0. Example: Dynamically creating input names The following JSP code fragment illustrates how to dynamically create names for the inputs of a form. 68 Customizing Web Intelligence . j++) { //use (recreate) the parameter names created in the form String[] values = request. if (doRefresh) doc. and the position of the prompt in the Prompts collection. text-entry prompts only. refresh.

i < prompts. //also sets getMustFillPrompts to false if ((values != null)&&(values.getStorageToken()). i++) { %> <tr> <td><%=prompts. ValuesSelected.setPrompts().getName()%></td> <td><input name=<%="PV"+i%> type="text"/></td> </tr> <% } //and add a row to the table for the submit button // DoRefresh and ValuesSelected help keep track of // where we are in the workflow %><tr><td> <input name="Token" type="hidden" value="<%=doc.sendRedirect("view. however.jsp? Token="+doc. //get user input if (doc. which is converted to a boolean when it is retrieved.getStorageToken()%>" /> <input name="DoRefresh" type="hidden" value="false" /> <input name="ValuesSelected" type="hidden" value="true" /> <input name="Submit" type="submit" value="OK"> </tr></td> </table> </form> <% } else //all prompts are filled and can now display the report response.jsp" method="post"> <table> <% //add a row to the table for each prompt // the names of inputs are created dynamically for (int i = 0.getMustFillPrompts()) { //build a form to get user input for the prompt %> <form name="PromptsForm" action="refresh.length != 0)) prompts.enterValues(values). %> Note: A flag is needed now to determine if there are prompt values in the query string.4 } } doc.getCount(). Customizing Web Intelligence 69 . This example uses a hidden input in the form.getItem(i).getItem(j). you could also use the first prompt parameter PV0 for this purpose.

See “Handling nested prompts” on page 74. To do this you detect if the prompt (object) has an associated list of values with Prompt. with Values. however the universe designer can edit this set as part of creating the object in the universe. For information on refreshing lists of values.. list of values for the Quarter object in the eFashion universe Table 4-1 Viewing the list of values for the Quarter object in Universe Designer. as options of an HTML select tag. Q3. The select tag for the list uses the same dynamic input naming described in “Dynamically creating input names” on page 68. These values are defined when the designer creates the object. Note: Prompt. Q2.getAllValues. then display them in the user input form.. if there is a list of values for the prompt. simple prompts (page 68). Handling prompts for objects that have lists of values involves extending the workflow for many. the Quarter object could have the following list of values {Q1. and the Customer object could have a list of values like this: {Adams. . Bean. Baker. this can cause problems with nested prompts which need to be handled. For example.hasLOV. Zane}. Example: Displaying a simple list of values The following JSP code fragment illustrates how to get the values of a LOV and display them in a form. but can be refreshed.getLOV automatically refreshes the report. to accommodate changes in the database. Arkwright. get the values in the list with Lov.getValue. //get user input if (doc. These values are the corresponding values found for the object in the database.4 Prompts with simple lists of values A list of values (LOV) is a set of values associated with a universe object.getMustFillPrompts()) { //build a form to get user input for the prompt %><form name="PromptsForm" action="refresh. automatically or manually..jsp" 70 Customizing Web Intelligence . see “Chunking long lists of values” on page 74. Q4}.

You can detect if a prompt is constrained with Prompt.getCount(). k < lovValues. some prompts can require several values before being filled. In Web Intelligence.getValue(k)%>"> <%=lovValues.4 method="post"> <table><% for (int i = 0. can have one or many responses before it is filled. the prompt. Constrained prompts A prompt is constrained if the answer must come from the prompt’s list of values. users create constrained prompts by selecting Select Only From List when creating a prompt filter for a query.getLOV(). if (prompt. Store name in list. %> <tr> <td><%=prompt. however.getItem(i). i++) { Prompt prompt = prompts.isConstrained.getName()%></td> <td> <select name=<%="PV"+i%> size=1> <% for (int k=0.getValue(k)%> </option><% }%> </select> </td> </tr><% } } %><tr><td> <input name="Submit" type="submit" value="OK"> </tr></td> </table> </form> <%}%> Note: The example “Handling multivalued prompts” on page 72 shows how to modify the select tag to handle multivalued prompts. Year equals. Customizing Web Intelligence 71 . whereas the prompt.hasLOV()) { Values lovValues = prompt. For example. Multivalued prompts Until now we have only considered prompts that can have one value. i < prompts.getCount(). can have only one response. k++){ %> <option value="<%=lovValues.getAllValues().

You detect a list of values with more than one column using Values.getRowValue to get a row in the table. To display the values in the list you use Values. However.getValue(k)%>"> <%=lovValues. Web Intelligence forms these kinds of prompts as two separate prompts. To detect how many values the prompt requires use PromptType. 72 Customizing Web Intelligence .Mono) {%> <select name=<%="PV"+i%> size=1><% } //multivalued LOV needs a different select statement else {%> <select name=<%="PV"+i%> multiple size=5><% } //add values in LOV to the select list for (int k = 0. Sales revenue is between X and Y. Example: Handling multivalued prompts The following JSP code fragment illustrates how to modify the <select> tag of the previous example (page 70) to handle multivalued prompts. A prompt can either be PromptType. the user must specify both X and Y before the prompt can be considered complete.getType() == PromptType.enterValues. A multicolumn list of values is represented in REBean as rows in a table with the RowValues interface. <td><% if (prompt. and then RowValue. k < lovValues.Mono or PromptType. When the user selects a row. The example below illustrates this.getValue(k)%> </option><% }%> </select> </td> Prompts with multicolumn lists of values A universe designer can create a list of values that has many columns.getType.getCount().getItem to display the values in the list. such as. Note: Prompt.Multi. make sure you pass just the value in the first column (index = 0) of the row to Prompt.isMultiColumns.4 Note: For prompts that use the Between operator. k++) { %> <option value="<%=lovValues.getHeader and RowValue. you do not need to treat them as a multivalued prompt.enterValues uses only the first value in each row to identify the row. Example: Handling multicolumn lists of values The following JSP code fragment illustrates how to display multicolumn lists of values in the select block of the example on page 70.

n++) { //build a string to display the <option> tag if (n == 0) valueText = row.getAllValues().getHeader(m). for (int n = 0. The variable value contains just the first value in the row. else valueText = valueText + " | " + row. k < lovValues.getItem(0).isMultiColumns()) { //MULTICOLUMN VALUES (2/2) option is a row RowValue row = lovValues.getLOV().hasLOV()) { //display the list of values Values lovValues = prompt. Customizing Web Intelligence 73 . which is passed to Prompt. %><tr> <td><%=prompt.getCount().enterValues to fill the prompt. m < lovValues. String valueText = value.n < row. for (int m = 0.getCount(). %><%=colNames%><br><% } //assume multivalue LOV %><select name=<%="PromptValue"+i%> multiple size=5> <% //get value and text for the option tag for (int k = 0. k++) { String value = lovValues.getRowValue(0). if (lovValues. valueText = "".getName()%></td> <td><% if (lovValues.isMultiColumns()) { //MULTICOLUMN VALUES (1/2) display the column names String colNames = "".getValue(k).getItem(n).getRowValue(0). whereas valueText displays all the values in the row.getCount().4 if (prompt. m ++) colNames = colNames + " | " + lovValues. value = row.getItem(n). } } %><option value="<%=value%>"> <%=valueText%> </option><% }%> </select> </td> </tr><% } Note: The value and valueText are different in multicolumn lists of values.getRowValue(k).

Nested prompts can be raised when a document containing prompts is refreshed and the prompts have lists of values that contain their own prompts.mustFillNestedPrompts to detect if a list of values contains its own prompts. In this example.getDocumentFromStorageToken(token).4 Chunking long lists of values Some objects.setBatchSize Handling nested prompts Sometimes a list of values contains its own prompts. If a list of values contains prompts.getValues Lov.refresh(). The Lov class has methods that you can use to divide long lists of values into “chunks” that are easier to display. similarly. //if there are prompts.setNestedPrompts to enter values for and set the nested prompts.getMustFillPrompts()) { 74 Customizing Web Intelligence . Example: Handling nested prompts The following JSP code fragment illustrates the recommended method for handling nested prompts. for example Customer name. Example: Order of filling a hierarchy of nested prompts Consider the following set of prompts: Select a town from the list: (prompt in query) Select a state from the list: (prompt on list of towns) Select a country from the list: (prompt on list of states) Each prompt qualifies the one above it in the hierarchy. a state must be defined before a town can be defined. then Lov.getPrompts(). A prompt in a list of values is called a nested prompt. and easier for the user to browse: • • • • Lov. prompts and nested prompts are handled by the recursive function fillPrompts. fill them if (docInstance. You use Lov.getCurrentBatchIndex Lov. //refresh first time only Prompts prompts = doc.getCurrentBatchName Lov.enterValues and Lov. those prompts must be filled before you can fill the prompts in the next level up.getNestedPrompts. if (doRefresh) doc. Prompt. can have a very long list of values. //get the document and its prompts DocumentInstance doc = re. the country must be defined before a state can be defined and.

After calling Lov. Customizing Web Intelligence 75 . the prompts on the lists of values must be filled every time the document is refreshed. Example: Refreshing a list of values containing nested prompts The following JSP code fragment shows how to use the fillPrompts function described in the example “Handling nested prompts” on page 74 to handle nested prompts raised when the list of values is refreshed manually.mustFillNestedPrompts()) { Prompts nestedPrompts = lov.refresh to provide a "Refresh List" button so that the user can update the list manually.getValues or Lov. docInstance. you can use Lov. null). however.getLOV().setPrompts().getAllValues. if (lov. the next time you call Lov. you can handle any nested prompts contained in the list of values with the fillPrompts function described in the example “Handling nested prompts” on page 74.sendRedirect("view. lov). Refreshing a list of values containing nested prompts If you provide a manual refresh option.refresh. } //get user input for pmts //enter values for pmts } if (parentLOV != null) parentLOV. } this. //FUNCTION .fillPrompts (prompts.getStorageToken()). i < pmts. Lov parentLOV) { //pmts is the set of prompts or nested prompts to be filled //parentLOV is a LOV for which there are unfilled nested prompts for (int i = 0. fillPrompts (nestedPrompts .getItem(i).jsp? Token="+doc. i++) { Lov lov = pmts.setNestedPrompts(). to make sure that the lists are up to date.4 } else //all prompts are filled and can now display the report response. the list of values will be refreshed. Refreshing a list of values If the document contains lists of values with prompts. Note: This process is independent of the document refresh mechanism.getCount().fill prompts and handle nested prompts public void fillPrompts (Prompts pmts.getNestedPrompts(). Note: You can use the methods described in “Prompts with simple lists of values” on page 70 to get the user input and enter the values for nested prompts.

this. “Viewing reports” on page 62 explains how to view reports.. 76 Customizing Web Intelligence .fillPrompts (nestedPmts. and hence the process. 5.. 2. 3. Set the contexts. simple prompts (page 68).getMustFillContexts. For more information about defining contexts see Designer’s Guide. The classes and methods. To fill a context prompt: If contexts must be filled.refresh(). The contexts in a document are represented by the Contexts collection. for filling a context prompt is similar to that for filling many. lov. Display the possible values for each context and get the user’s response. and you can detect if a document has contexts to fill with DocumentInstance. Enter the values for the context provided by the user.4 //get and display the LOV //if the user clicks "Refresh List" . Get contexts. Handling context prompts Universe designers define context prompts in universes to ensure users retrieve the appropriate data when there is more than one way to get the results of a query. 1.getNestedPrompts(). Prompts nestedPmts = lov. View the report. 4. lov).

Displaying a report map
A report map is a representation of the reports and report sections in a Web Intelligence document. There are two modes for calculating the contents of a report map: incremental and non-incremental. In incremental mode only the requested information is calculated, and in non-incremental mode the whole report map is calculated in one step. To get the report map for a document use DocumentInstance.getReportMap. Example: Traversing the report map for a Web Intelligence document The following JSP code fragment traverses the following report structure and gets a section as HTML.
Section1 Report1 map.getStructure() Report2 Report3 Section2 Section1 Section2 Section2


ReportMapNodes = ReportMapNode

// Get the ReportMap from the document instance ReportMap map = doc.getReportMap(); //point to the root node of the structure ReportMapNodes root = map.getStructure(); // Get the number of reports in the document // There are three in this case: Report1, Report2, and Report3 int count = root.getChildCount(); // Get the first report ReportMapNode report1 = root.getChildAt(0); // Get the name of the report (Report1) String reportName = report1.getName(); // Get the report path (0) String reportPath = report1.getPath(); // Check if the report contains sections (true in this case) boolean leaf = report1.isLeaf(); // Get the number of sections in the report

Customizing Web Intelligence 77

// There are two in this case: Section1, Section2 int section_count = report1.getChildCount(); // Get the first section ReportMapNode section1 = (ReportMapNode)report1.getChildAt(0); // Get the section name (Section1) String sectionName = section1.getName(); // Get the section path (0/0) String sectionPath = section1.getPath(); // Get the HTML page associated with this section Report report = doc.setPath(sectionPath); HTMLView view = report.getView(OutputFormatType.HTML);

78 Customizing Web Intelligence

Customizing Web Intelligence

Drilling in Web Intelligence Reports


2. The request contains information about the drill operation. they can adjust the amount of detail in the reports by entering drill mode and drilling up or down according to the dimension hierarchies (often called “drill hierarchies). but also for the dimensions that the user has included in the scope of analysis. When users view reports. The drilling process To provide users with a drill function. City. from which dimension the drill starts. Zip Code. Note: Depending on their user rights. Universe designers create hierarchies of dimensions when they create universes. some users might not have access to the drilling functions. Web Intelligence retrieves data for the dimensions in the query. helping users analyze document data. Street. You use REBean to drill in Web Intelligence reports. Users set the scope of analysis to control how much data Web Intelligence includes in the data provider (cube) it creates when a query is executed. the name of the script that will handle the request. State.5 Overview Drilling is one of the key features of Web Intelligence documents. for example Country. The script defines the drill operation by initializing the document’s drilling objects with the information passed in the drill request. This means that when a user drills through a dimension hierarchy the information for the new report is in the data provider. Note: The user executing the query might not be the user that set the scope of analysis. User requests a drill operation by clicking on a drill link in a report. This chapter discusses how to provide drilling facilities for Web Intelligence documents. and it is not necessary to execute a new query to display the drilled report. See also “Drilling out of scope: the scope of analysis” on page 82. implement the following process: 1. When a user executes a query. 80 Customizing Web Intelligence . and to which dimension it goes. For example. Introduction to drilling Drilling is a way for a user to control the amount of detail in a report.

Repeat steps 2 to 4 for each request for a drill operation.5 3. 5. 4. Defining the drill operation involves: • • • • getting the parameters of the drill request defining the query string parameters entering and leaving drill mode setting the drill path Customizing Web Intelligence 81 . Web Intelligence uses the information in the document’s drilling classes to generate the drilled view.jsp 4 dri ll req ue st 5 Table 5-1 The process you need to implement to provide a drilling function Defining the drill operation You can only define drill operations for drillable documents. The script displays the drilled view generated by Web Intelligence. 1 s ue req ll t Drill Option dri 2 Define drill 3 Generate HTML Drill Path View report view. A document is considered drillable if the dimensions used to form the query are part of a dimension hierarchy. The script instructs Web Intelligence to generate the HTML for the drilled report.

82 Customizing Web Intelligence . When this is functioning. You can see drill hierarchies in the Report Panel. Transparent Drill Outside of Cube The Web Intelligence facility for automatically handling out of scope drill requests is called Transparent Drill Outside of Cube. To fulfill this request the query must be reformed and rerun to retrieve the requested data. the scope of analysis of the query is automatically reset to incorporate the data for the requested dimension. Generating the HTML and viewing a drilled report This step in the drilling process involves generating the HTML for the report using the drill operation you have defined.5 The details of how you define the drill operation depend on the type of report. For information on manually handling out of scope drills for Web Intelligence reports see page 88. Drilling out of scope: the scope of analysis An out of scope drill is one that goes up or down to a dimension that is not in the data provider. How you manually handle out of scope drills depends on the type of report. it acts as a dimension filter. Drill hierarchies Hierarchies contain dimensions and are defined by universe designers. When a value is selected from the list. Once you have done this you can view the report as HTML using the normal workflows. You can handle out of scope drills manually or transparently. Supervisors can control a user’s access to this facility using Supervisor. A dimension contains a list of values. For information on defining the drill operation for Web Intelligence reports see page 83. however the mechanism for transparently handling out of scope drills does not depend on the report type.

The drill path is represented in REBean by the DrillPath interface. 2. Enter drill mode. Set the drill path. To define the drill operation: 1. Drill hierarchies defined in a universe Use Report. and specific drill objects added by the user.5 Drilling in Web Intelligence reports To provide drilling functions in Web Intelligence reports you can implement the process described in “The drilling process” on page 80. Define the query string parameters. Customizing Web Intelligence 83 . use DrillInfo. Drill bar DrillBar exposes drill and report filters. or by examining the drill bar.getDrillHierarchies.Analysis. or use the drill bar to filter the query. The DrillBlock object gets the drill hierarchies and dimensions for just one block (table or graph) in the report. or a detail. A hierarchy is used if one of its dimensions is included in the query for the report. Defining the drill operation. 3. There are two modes: ReportMode. Get the parameters of the drill request.getNamedInterface(“DrillInfo”) to get the DrillInfo class. Drilling information You can access drilling information by examining the contents of the universe (the drill hierarchies and dimensions). involves setting the parameters of the drill path object. Entering and leaving drill mode You need to put Web Intelligence into a special mode so that it can perform the drilling functions.Viewing and ReportMode. 4. To get the hierarchies used in the report. therefore. use DrillInfo. A drill object can be a dimension. if required. and consists of a set of parameters such as the IDs of the objects (dimensions) from and to which the user is drilling. Defining the drill operation A drill operation is defined in terms of the drill path.getFreeDimensions. To get the dimensions and details that are not included in a hierarchy but are used in the report.

gif Example: Defining the query string parameters The following JSP code fragment shows how to define the query string parameters used to pass drill information to the Javascript functions that generate the hyperlinks and popup menu. remember that drilling methods such as beginDrill and executeDrill generate new tokens for the document. This is always ApplicationName/images/cdz/drillup. option. String action = request.beginDrill puts a report in ReportMode. option. and how you manage storage tokens (document state) you might need to include the storage token in the call back script definition.Viewing mode.setStorageTokenHolder("Token").setHierarchyHolder("Hierarchy"). then use the new names to retrieve the details of the user’s drill request and.setFilterHolder("Filter").setBlockHolder("Block"). option.setCallBackScript("drillHandler. Note: Notice that you can add your own query string parameters to the call back script definition. String[] to = request. to set the drill path.setBlockSynchronized(true). option. Getting the parameters of the drill request To get the parameters of the drill request use request. which are generated by Web Intelligence using Javascript functions and style sheets (see “Generating the HTML and viewing a drilled report” on page 82). String block = request. option. 84 Customizing Web Intelligence .setToHolder("To").getParameter("Action").Analysis (drill) mode.5 Calling DrillInfo. option.setCallBackFrame("_self").setFromHolder("From"). Defining the query string parameters In Web Intelligence users drill with hyperlinks and a popup menu. You can redefine the query string parameters with the DrillOption class.jsp?ReportIdx=0”). option. Depending on the architecture of your application.getParameterValues("To").getParameter("Block").getDrillOption().endDrill stops the drill session and puts a report in ReportMode.getParameter("Token"). hence. If you do this.setDrillActionHolder("Action").getParameterValues. For example: String token = request.getParameter and request. option. option. which provide the user with drilling functions. option. //set up the query string parameters used for drilling DrillOption option = info. Calling DrillInfo. Note: You cannot change the name and path of the image used to indicate the drill up hyperlinks.

down. String[] filter = request. Set the object id of the drill to element. 4. by. 3. String[] hierarchy = request.setAction. 5.5 String[] from = request. Set the drill action. down. The report engine replaces the current object with an object that is not adjacent to it in the drill hierarchy. Set the object id and filter of the drill from element. The actions are enumerated by DrillActionType. by. To set the drill path: 1. See “Setting the action: up. Customizing Web Intelligence 85 . Set the block id.getParameterValues("From"). or slice A user’s drill actions are classified by how they move through the drill hierarchies. Get the drill path. hierarchy 1 dimension 1 down down or by dimension 2 dimension 3 hierarchy 2 dimension 5 up dimension 6 by dimension 7 slice dimension 4 Table 5-2 Different drill actions You set the drill action with DrillPath. The report engine adds or removes the filtered values. or slice” on page 85 below. 2.getParameterValues("Filter"). Setting the action: up. Drill action Resulting report engine action Up Down By Slice The report engine replaces the current object with its parent in the drill hierarchy.getParameterValues("Hierarchy"). The report engine replaces the current object with its child in the drill hierarchy. Setting the drill path The drill path defines the drill operation.

if any.getTo and DrillPath. you define the elements of the drill. if you drill down to Quarters from Year = 2003. 4. 3.equals("slice")) drill. Individual from and to elements are represented by DrillFromElement and DrillToElement.length.DOWN). Add drill elements to each collection. The parameters of the drill (action. } } 86 Customizing Web Intelligence . for (int j = 0. all the quarters for 2003 are displayed. 2. For each from element.j < to. //set the ACTION if (action.equals("up")) drill. Example: Setting the drill path The following code fragment shows how to set the values of the drill path. However for drill-up actions the filter is removed.getDrillPath().setObjectID(to[j]).add(). block) are retrieved as described in “Getting the parameters of the drill request” on page 84. set the filter. DrillPath drill = info. For each drill operation: 1.BY). //set the TO drill elements if (to. else if (action.getFrom. only Year= 2003 is displayed.getTo().setAction(DrillActionType.UP). j++) { DrillToElement toElement = (DrillToElement) toElements. toElement.5 Setting the from and to parameters To set the from and to parameters of the drill. else if (action.setAction(DrillActionType.equals("by")) drill.SLICE). all the values for Years are displayed. The elements of the drill are the dimensions involved in the drill action and are represented by the DrillElements interface.length > 0) { DrillElements toElements = drill.setBlockID(block). Note: For example. There is a DrillElements object for the to and for the from dimensions. from. Get the drill from and to elements with DrillPath.equals("down")) drill. Set the object IDs of each drill element using the values you retrieve from the query string.setAction(DrillActionType. However if you drill up from Quarters to Year. else if (action. then if you drill by Year. to.setAction(DrillActionType. Note: The filter remains for drill-by actions between dimensions in the same hierarchy. in the Time Period hierarchy. //set the BLOCK drill.

for (int k = 0. This is true for simple drilling. To get these files. k < from.getString (see “Displaying the drilled report” on page 88. Generating the HTML and viewing a drilled report To generate the HTML for the report execute the drill with DrillInfo. if you set a filter for a drill-up operation. it is ignored. Also. fromElement. if ((filter != null) && (filter.length. then view the generated HTML using HTMLView. k++) { DrillFromElement fromElement = (DrillFromElement) fromElements. in the part that sets the filter. however. you can add the condition ‘if !action.length > 0)) fromElement.js Where language is the language of the messages.add().equals(“up“)’ since there is no filtering in a drill-up operation.js drillcontext.gif files in the images folder of wijsp. These scripts use the styles defined in bomenu.executeDrill.getView(OutputFormatType.setFilter(filter[0]). } } This example assumes that there is only one value in the array filter— fromElement. Copying the Java script files for drilling The Java script files used to create the drilling user interface are stored in /businessobjects/enterprise11/desktoplaunch/viewers/cdz/.5 //set the FROM drill elements if (from.setObjectID(from[k]). copy the following to the directory containing the copied Java script files: Customizing Web Intelligence 87 .js /language/language/message. Copy the following files from this directory to the same directory as your script that displays the HTML view of the report.getFrom().setFilter(filter[0]). In drill mode (ReportMode.Analysis) when you call Report. • • • • • bomenuIE.js drillcontextDom.js browserDetection. however.css and the . to handle more sophisticated drilling you need to use all the values in the array of filters.length > 0) { DrillElements fromElements = drill. See also “Viewing an individual report in HTML” on page 63).HTML) Web Intelligence generates HTML that uses scripts and style sheets to provide the drilling interface.

DRAW REPORT--> <%=htmlView. For an example of how to do this. <% HTMLView objHTMLView = null. Alternatively you can call HTMLView.5 • /businessobjects/enterprise11/desktoplaunch/viewers/cdz/style/ skin_name/bomenu.css"> <%=htmlHeader%> </head> <!-.getStringPart("body". To display characters such as the yen symbol (¥) use bomenu_fe. • /businessobjects/enterprise11/desktoplaunch/viewers/cdz/images/ Referencing the Java script files for drilling The HTML generated by Report.getStringPart("head".getView(OutputFormatType.getString("head". htmlView = (HTMLView) rep.getView references these files and you need to include this in your header with HTMLView. String htmlHeader = htmlView. %> <html> <!-. however.isInScope. Example: Displaying the drilled report The following JSP code fragment illustrates how to display a report after executing the drill.HTML). 88 Customizing Web Intelligence . false).getString() which retrieves both the appropriate HTML header and the drilled report.getStringPart("body". it means you can't add supplementary HTML to the page.willGoOutOfScope. false). or skin_coloredline. call HTMLView.css. The fonts used in bomenu.DRAW HEADER --> <head> <link rel="stylesheet" type="text/css" href="style/bomenu. true)%> </html> Manually handling out of scope drill requests Once you have set the DrillTo and DrillFrom elements you can detect if a drill dimension is not in scope with DrillDimension.css skin_name is one of: skin_default. and if the defined drill operation contains out of scope dimensions with DrillInfo. skin_corporate. Displaying the drilled report To display the drilled report.css do not include some special characters. see “Displaying the drilled report” on page 88. false).

the Resort dimension filtered on the Bahamas Beach value.executeDrill.extendScopeOfAnalysis. You commit the changes you make to the scope of analysis by calling DrillInfo. Adding query conditions using the drill bar You can use the filters in the drill bar to add query conditions when extending the scope of analysis. See also. Drill objects can be dimensions. the drill bar is initialized with the report filter. Adding objects that have prompts If you extend the scope with an object that contains an @Prompt in its universe definition.add and Drillbar. the DrillBar object contains three objects. but it can be customized by the user to add or remove drill objects.remove.5 If the DrillDimension is outside the scope of analysis you can manually extend the scope of analysis with DrillInfo. and you add and remove objects to and from the drill bar with DrillBar. and the unfiltered Service Line object. This method returns a DrillElements collection to which you can add the extra drill dimensions that the user wants to include in the analysis.getDrillBar. See “Handling prompts” on page 66 to find out how to do this. For example. “Adding query conditions using the drill bar” on page 89. You access the drill bar with DrillInfo.addQueryConditions. Filtering with a drill bar The DrillBar object exposes the drill filters and specific objects added by the user. You commit this change with DrillInfo. if the drill bar has the filter Country = US. it is automatically removed from the report filter. In the example below. or details. the Country dimension filtered on the US value. you need to fill the prompts it raises before you execute the drill. If you want to add a query filter to the extended scope of analysis. when the scope is extended you can use this object to form a query condition Customizing Web Intelligence 89 . By default. Note: When you remove an object from the drill bar.executeDrill. use DrillInfo. This returns a DrillElements collection to which you can add the ID of the filter dimensions and the associated filter values.

90 Customizing Web Intelligence .5 before executing the SQL.snapshot to put aside a drilled view and continue drilling. This method adds a report containing the current view to the document’s report list and report map. For more information see “Manually handling out of scope drill requests” on page 88. For example. This limits the amount of information returned into the cube to results for Country = US. the results for Quarter are automatically limited to Quarter = Q1. if you set the filter Month = February. Taking a snapshot of a drill You can use DrillInfo. you cannot view the results for Month = February and Quarter = Q3. If you add a condition to the query. and is more rapid than retrieving the results for all the values of Country. The filters set in the drill bar can affect other result objects. information in other reports in the document might change. Note: Changing the query affects all the reports in the document.

Customizing Web Intelligence Building and Editing Data Providers chapter .

This chapter explains how to use REBean to build data providers and edit queries for Web Intelligence reports. Data providers A data provider has two parts: a query and a data source. Using a data provider you can get the SQL for a query. This helps when you are providing drilling features (see “Scope of analysis” on page 99 and “The drilling process” on page 80). also known as result objects) of interest and conditions which restrict the data retrieved. Conditions on queries are expressed as a syntax tree in which conditions and operators (for example AND. The query can also have an associated scope of analysis which includes more data in the retrieved microcube than the query requires. This syntax tree is created with the ConditionContainer set of classes. retrieve the data returned when the query is executed. See “Conditions” on page 100. The query The query part of a data provider defines the data to be retrieved. REBean exposes the following universe elements: • • • • • • class hierarchy dimension measure detail predefined condition 92 Customizing Web Intelligence .6 Overview A data provider holds information about a query. and explore the data source (universe) through which the data was retrieved. The query of a data provider is exposed in REBean through the Query and Scope objects. and EQUAL TO) are nodes in the tree. The data source The data source of a data provider gives you access to the universe used to define the query. The query is expressed in terms of the data source objects (universe objects.

Note: You use DataSourceObject to create and edit the query. conditions. dimensions. or hierarchies. but after you execute the query the objects are stored in the document's dictionary as ReportExpression objects. Use the following classes to explore a universe: • • • DataSource (universe) DataSourceObjects (classes and hierarchies in the universe) DataSourceObject (elements of the universe) Universe elements can be classes. measures. Customizing Web Intelligence 93 .6 Using the classes that expose these universe elements. or as drill hierarchies in a drill bar. details. DataSourceObject is a specialization of the TreeNode class. you can present the contents of a universe to users as classes and objects for query editing.

You use the <applet> or <object> tag to declare the applet. All parameters are of the type java.lang. and the <param> tag to specify the applet’s parameters. Table 6-1 The Web Intelligence Java Report Panel Note: This applet is different from previous releases of Web Intelligence.String.6 Building a data provider You can build a data provider by: • • integrating the Web Intelligence Java Report Panel into your application building a data provider manually with REBean classes Integrating the Web Intelligence Java Report Panel into your application The Web Intelligence Java Report Panel is the standard method for users to create data providers and edit queries. Launching the Web Intelligence Java Report Panel You launch the Web Intelligence Java Report Panel using JSP. 94 Customizing Web Intelligence .

Port CdzSession Document parameters Token RepoType The type of the repository in which the document is stored. getServerInstance use the string returned by DocumentInstance. “jp” The name of the applet. DocumentID - Customizing Web Intelligence 95 . “Web Intelligence Report Panel” “/webiApplet/ ThinCadenza. The language of the user interface. “inbox”. The name of the server from which the applet is downloaded.w The path to the p.jar” “en”. Value(s) Description HelpRoot Lang Server parameters Server - Isapi “/servlet/ com. “personal”. CadenzaServlet” default is “8080” use the string returned by ReportEngine.businessobjects.TCMain” zlet. The path to the servlet through which the server and the browser communicate. The port used for the application server The session identifier for the open document. getStorageToken when editing an open document “corporate”. The storage token for the The id of the document. The path to the archive containing the applet The path to the online help.6 Parameters Applet parameters code useslibrary useslibrarycodebase “com.

96 Customizing Web Intelligence . For example.query(sQuery). For example. If present. The id of the universe on which the query will be run. String ID){ IInfoObjects universes = null.UNIVERSE +"'". the applet automatically opens the first class of the universe. <% IInfoStore iStore = (IInfoStore) session. Example: Launching the Web Intelligence Java Report Panel The following example shows JSP functions that use BusinessObjects Enterprise SDK to recover a universe object from a valid ID.http. you do not need to provide a storage token.6 Parameters DocumentName Value(s) Description The name of the document. }catch(Exception e){ universe = null.getServerPort to populate the Server and Port parameters.getServerName and request.get(0). OpenFirstClassOfUniverse - Data source parameters UniverseID - You can use the implicit JSP request object (javax. Note: Some parameters are optional depending on what you are doing with the applet.servlet. try{ String sQuery = "SELECT SI_CUID. if(universes. IInfoObject universe = null. } return universe. if you are creating a new document. } %> // The following JSP script retrieves all necessary // parameters and then launches the Web Intelligence Java // Report Panel. you can use request. This Universe can be used to supply information necessary to start the Java Report Panel <%! IInfoObject getUniverse(IInfoStore iStore. SI_NAME FROM” + “ CI_APPOBJECTS WHERE SI_ID = " + ID + " AND SI_KIND = '"+ CeKind.HttpServletRequest) to get the values for some of these parameters. universes = (IInfoObjects) iStore.getAttribute("InfoStore").size() > 0) universe = (IInfoObject)universes.

wp.getServletPath().getAttribute("ReportEngine").businessobjects. currPath = contextPath + currPath.getContextPath(). String instanceID = wiRepEngine.createServerInstance().jar" style=" width: 100%.jar" > <PARAM NAME="type" VALUE="application/x-java-applet.getCUID()%>"></PARAM> <PARAM NAME="bRobot" VALUE="false"></PARAM> <PARAM NAME="bTraceInLogFile" VALUE="false"></PARAM> <PARAM NAME="HelpRoot" VALUE="<%= contextPath. universe = getUniverse(iStore.TCMain" CODEBASE="<%= contextPath %>/webiApplet/" ARCHIVE="ThinCadenza.TCMain" > <PARAM NAME=CODEBASE VALUE="<%= contextPath %>/webiApplet/"> <PARAM NAME=ARCHIVE VALUE="ThinCadenza. int serverPort = request.getParameter("uID").tc.jsp"></PARAM> <PARAM NAME="Lang" VALUE="<%= request.")).6 ReportEngine wiRepEngine = (ReportEngine) session.substring(0. String strWISession = instanceID.getServerPort().businessobjects.instanceID.indexOf(".substring( 0. %> <APPLET CODE=""> <PARAM NAME="Isapi" VALUE="<%= contextPath %>/CadenzaServlet"></PARAM> <PARAM NAME="Server" VALUE="<%= serverName %>"></PARAM> <PARAM NAME="Protocol" VALUE="http"></PARAM> <PARAM NAME="Port" VALUE="<%= serverPort %>"></PARAM> <PARAM NAME="Type" VALUE="signed"></PARAM> <PARAM NAME="WebiSession" VALUE="<%= strWISession %>"></PARAM> <PARAM NAME="CdzSession" VALUE="<%= instanceID %>"></PARAM> <PARAM NAME="DocumentID" VALUE=""></PARAM> <PARAM NAME="UniverseID" VALUE="UnivCUID=<%=universe.wp. currPath = currPath. height: 100%. ID). String ID = request.getLanguage() %>" ></param> </APPLET> Customizing Web Intelligence 97 . currPath. String contextPath = request. String serverName = request. if (universe != null){ String currPath = request.substring(1) %>"></PARAM> <PARAM NAME="SaveAs" VALUE="<%= contextPath %>save."> <PARAM NAME=CODE VALUE="com.getServerName().getLocale().lastIndexOf( '/' ) + 1 ).

. 5. q. Query q = dp. Get the query for the data provider.getChildByName ("year"). DataSourceObject city = ds. // Add result objects to the query q. The data provider has a data source and an empty query object. To build a data provider: 1. // Run the query: execute the query and fetch the data dp. // Retrieve the universe objects DataSource ds = dp. DataProviders dps = doc.6 Building a data provider manually When you create a new document instance. 6.addResultObject (city).getItem(0). Building a data provider consists in populating the query object with the data source objects in which you are interested.getChildByName("city"). Editing queries A query is represented by the Query object and has the following parts: • a list of result objects 98 Customizing Web Intelligence . Add result objects. 2. Get the universe elements in which you are interested. 4. Execute the query.getDataSource (). //create a new document instance DocumentInstance doc = reportEngine.runQuery(). q.getClasses(). //select a universe ==> sID . Add condition objects (optional).getDataProviders(). Example: Building a data provider The following JSP code fragment illustrates how to populate the query object of a data provider.getClasses(). Web Intelligence automatically creates an empty data provider for the document.getClasses().newDocument(sID).addResultObject (sales). 3. Get the collection of data providers for the document.addResultObject (year).. DataSourceObject sales = ds. // Retrieve the 1st data provider DataProvider dp = dps. DataSourceObject year = ds.getQuery().getChildByName ("sales").

If you modify the elements in the scope of analysis. however. This is very helpful in drilling as it is avoids modifying the query for every drill operation. see “Block structure: axes and report expressions” on page 110) and is available for editing reports. use DataProvider. To add a result object to the query. A scope level of LEVEL_1 indicates that just the result object specified in the query is retrieved. use Query. use Query. starting with the result objects specified in the query. If you create a scope of analysis that does not match an existing hierarchy. for example. the scope level is set to CUSTOM.removeResultObject. Web Intelligence changes the scope level accordingly.getScope. Web Intelligence sets the scope level to LEVEL_2.addScopeObject and Scope. if you remove the Quarter object from the scope of analysis so that a drill on the Year goes to the Month object. The scope level specifies how many objects of a class hierarchy are retrieved when you run the query. To get the scope of analysis for a query.6 • • Result objects A result object is a class or an object in a universe. a scope of analysis that defines the amount of data available in the cube conditions that restrict the amount of data retrieved from the data source To get the query for a data provider. The scope level can be LEVEL_1. To modify a scope of analysis add and remove the objects you want in the scope of analysis with Scope. Scope of analysis The scope of analysis is a feature that enables you to include more information in a cube than the query requires. The scope of analysis is defined in terms of the scope level and is represented by the Scope interface.getQuery. if you remove the third level from a LEVEL_3 scope of analysis. use Query. When you execute the query.removeScopeObject. LEVEL_2. Customizing Web Intelligence 99 . See “Drilling in Web Intelligence Reports” on page 79. LEVEL_3. Including a result object in the query is the same as dragging and dropping an object into the Results area of the Query Panel of the Web Intelligence Java Report Panel. will be included in the retrieved results. or CUSTOM. the result object is added to the report dictionary (as a report expression.addResultObject. To remove a result object from the query. A scope level of LEVEL_3 indicates that the first three objects in the class hierarchy.

createConditionObject(revenue). fc. and unary operator. a data source object. between 1995 and 1999. Revenue. FilterConditionContainer ConditionObject FilterCondition getDataSourceObject = Revenue getOperator = NOT_IS_NULL The FilterCondition class holds information about operators and operands. such as BETWEEN. achieved revenues below the company average. For more information on conditions see Web Intelligence User’s Guide. Query q.createFilterConditionConstant("10000"). For some operators. Simple conditions The simplest condition consists of a container. //query to which the condition is applied //create a container for the condition ConditionContainer c1 = q. //create an object for the condition ConditionObject co = c1. In REBean. the query would return only data about the stores that. the FilterCondition contains more than one operand. //create a FilterCondition object to contain information //about the operator and the operand FilterCondition fc = co. in the condition (Revenue is not NULL).createFilterCondition(Operator. and Company Average.createCondtion(). then define the condition ((Year between 1995 and 1999) AND (Revenue < Company Average)). For example. Store. Complex conditions By combining containers with operators and adding extra condition objects you can build very complex conditions.LESS). this condition is represented as follows. and is sometimes called a query filter. 100 Customizing Web Intelligence . and “is not NULL” is the operator. For example. “Revenue” is the object. if you add the result objects Year. Example: Creating a simple condition The following JSP code fragment creates the condition (Revenue < 10000).6 Conditions A condition is a constraint on the data retrieved when you run a query.

EQUAL). Including a prompt in a condition To include a prompt in a condition use FilterCondition. You handle these prompts with the same workflows that are described in “Handling prompts” on page 66. //create a container for the condition ConditionContainer cc = q. the question that is asked)..createConditionPrompt. You can also define properties such as its default value. and it does not need a corresponding FilterCondition object. This method returns a ConditionPrompt object that you can use to define a prompt that is activated when the query is executed.6 Example: Structure of a complex condition The following is a representation in REBean of the condition: (Revenue < 1000000) OR ((Year = 2002) AND (Holiday)). //create a FilterCondition object to contain the prompt FilterCondition fc = co. Example: Including a prompt in a condition The following JSP code fragment creates the condition prompt “Year?” //get the query (q) to which the condition is applied //..createConditionObject(country). //create an object for the condition ConditionObject co = cc. //define the prompt Customizing Web Intelligence 101 . and whether or not it is constrained to a list of values. FilterConditionContainer(OR) ConditionObject FilterCondition getDataSourceObject = Revenue getOperator = LESS getOperand = 1000000 FilterConditionContainer(AND) ConditionObject FilterCondition getDataSourceObject = Year getOperator = EQUAL getOperand = 2002 ConditionObject getDataSourceObject = Holiday In this example the data source object used for the last part of the condition (Holiday) is a predefined condition that is part of the universe.createFilterCondition(Operator. As with normal prompts when you create a condition prompt you need to define the name of the prompt (that is.createCondition().

6 ConditionPrompt cp = fc. the user must set these using the same procedure as for viewing a document.executeQuery Getting the SQL for the query Web Intelligence uses the properties of the Query object to create the SQL statement it executes when you execute the query.runQuery puts the data it retrieves into the results recordset of the data provider. DataProvider.createConditionPrompt("Country?").getSQL. It is possible to execute a query without retrieving data.addDefault("Australia"). use Query.getResults to retrieve the recordset.setMonoValue(true). cp. To get the SQL for a query. 102 Customizing Web Intelligence . DataProvider. To execute the query and… not retrieve the data The user does not need to set any prompts or contexts. Executing queries and retrieving the data When a query is executed and data retrieve. Use DataProvider. retrieve the data If there are prompts or contexts. For an example of how to access the values in the recordset see “Working with Recordsets” on page 119. cp. in which case no prompts or contexts need to be handled.runQuery Use… DataProvider.setConstrained(false). contexts and prompts are raised that need to be handled. cp.

Customizing Web Intelligence Formatting Reports chapter .

and page decoration. sections. IInfoObjects universes = null. cells. String unvQuery = "SELECT SI_ID.wid) create and edit document structures. Creating and editing the document structure You can access and change the structure of a Web Intelligence document. SI_PARENTID.7 Overview Web Intelligence SDK contains classes and methods for controlling the format of reports. IInfoObjects rootDirs = null. SI_NAME. String rootQuery = "SELECT SI_ID.newDocument. IInfoObjects getUniverses(IInfoStore iStore. SI_CUID. Using this ID an IInfoObjects containing information about Universes stored in the Central Management System is returned. A Web Intelligence document is made up of at least the following elements: • • • • • • • report page header/footer report body sections blocks report cells free cells A document can also contain: It is often useful to create a blank Web Intelligence document within which you can manually build queries and report structures. SI_NAME FROM” + “ CI_APPOBJECTS WHERE SI_PARENTID=" + ROOT_FOLDER_ID .” + “ SI_OWNER. Applications for formatting Web Intelligence reports (*. Example: Creating a blank document This example shows a JSP functions that use BusinessObjects Enterprise SDK to recover the ID of the Universe parent folder. To create a blank document use DocumentInstance. This chapter discusses how to use REBean to format Web Intelligence reports. SI_KIND" + " FROM CI_APPOBJECTS WHERE SI_ANCESTOR=". int searchID) { int ROOT_FOLDER_ID = 95. 104 Customizing Web Intelligence .

getAttribute("InfoStore").getAttribute("ReportEngine"). iID). //then create the blank document DocumentInstance doc = webiRepEngine.getID()).7 try{ //get the Universe Root directory rootDirs = iStore.query(rootQuery). IInfoObjects universes = getUniverses(iStore. //Recover the universe list IInfoStore iStore = (IInfoStore)session. universes = iStore. } return universes. ReportEngine webiRepEngine = (ReportEngine)session. unvQuery += rootDir. } }catch (SDKException sdke){ universes = null. if (rootDirs.getID(). } catch (Exception e){ universes = null.newDocument(universe.get(0). } The following code fragment creates a blank document using the first universe in the collection of universes as a data source.size() > 0){ //Get the Universes IInfoObject rootDir = (IInfoObject)rootDirs. Customizing Web Intelligence 105 . //Get the first universe IInfoObject universe = (IInfoObject)universes.get(0).query(unvQuery).

and two blocks. report page header free cell report page header free cell report body free cell section block block free cell report cell report body section section block page footer free cell page footer free cell Table 7-1 Structures of a document with one report. two sections. Notice that. and cells cells sections. and another with one report. report body sections. blocks. blocks. to have two sections in a report. and ReportElement. and cells The containment relationship between the elements of a document is represented in the object model as a tree using TreeNode. one section. ReportElementContainer. the relationship between the sections is containment.7 Representing document structure through containment Document elements are structured according to their containment relationship. and one block. This element… report report body page header/footer section Can contain these elements… page header/footer. 106 Customizing Web Intelligence .

applyFormat().getAxis(). footer.newDocument("1"). Also. It then creates a section and a block and adds universe objects (report expressions) to the block. //[Year] // create a block ReportBlock block1 = sectionYear.createBlock ().7 Example: Creating a document structure The following code fragment creates the document structure shown in the diagram. Cell headerCell = header.HTABLE. BlockAxis hAxis2 = block2. //[Sales Revenue] doc.addExpr(quarterExpr). hAxis2. //create an empty document and a new report DocumentInstance doc = engine.getPageFooter().getBodyReport().getAxis(TableAxis. Table 7-2 Report structure defined by the code example above Note: The header. and report body elements are created by default. the default type is TableType.HORIZONTAL). Customizing Web Intelligence 107 .addExpr(yearExpr). PageHeaderFooter header = report. BlockAxis hAxis = block1.getPageHeader(). when you create a block.createSection(). PageHeaderFooter footer = report.getAxis(TableAxis. Cell footerCell = footer.createReport("My Report"). sectionYear. BodyReport body = report. ReportContainer report = doc. // create a section SectionContainer sectionYear = body.HORIZONTAL). hAxis. This code creates a new document and a report and adds information to the header and footer parts.createBlock ().addExpr(revenueExpr).createFreeCell("footer cell"). //[Quarter] // create another block ReportBlock block2 = body.createFreeCell("header cell").

BOTTOM or NONE. Vertical anchors can be either TOP. is not known at the time the report is formatted. horizontal anchor and a pair of x-y co-ordinates. elements are positioned using x-y co-ordinates referenced from the top left corner of the containing element. An attachment is a way to position a Cell or ReportBlock element relative to other elements. For example. sometimes elements overlap. To avoid this you can use the attachment feature. xb1 yb1 block 1 cell 1 attachmentb1-b2 block 2 xc1 attachmentb1-c1 yb2 Table 7-3 Positioning elements relative to the parent container and siblings. and the anchor between block 1 and cell 1 has a vertical anchor set to NONE and a horizontal anchor set to RIGHT.7 Positioning document elements By default. An attachment consists of a vertical anchor. Horizontal anchors can be either RIGHT or LEFT or NONE. Using attachments to avoid overlapping elements Since the size of some elements. for example table blocks. 108 Customizing Web Intelligence . in the diagram below the attachment between block 1 and block 2 has a vertical anchor set to BOTTOM and a horizontal anchor set to NONE. x y body report free cell You can express x and y in millimeters or inches.

getReportBody().setX(200d). //units = UnitType. Example: Editing the sections of a report The following code fragment creates two sections. and. When you add report expressions to the section’s axis.setY(10d). each report expression has a corresponding report cell.setX(150d). VAnchorType. A section has one axis with one report expression. // Yb2 Creating and editing sections A report can have zero or more sections.getReportBody(). ReportExpression reCountry. // Attach cell 1 to block 1 (RIGHT attachment): b1-c1 c1.RIGHT). // Yb1 // Create block 2 (b2) and cell 1 (c1) ReportBlock b2 = report.setAttachTo(b1. sc2. sc2 = sc. sc2.createSection().addExpression(reCountry). HAnchorType. VAnchorType. // Xc1 // Attach block 2 to block 1 (BOTTOM attachment): b1-b2 b2.createBlock().getAxis(). // Position cell 1 relative to block 1 c1.NONE. each one containing blocks. sc.createBlock(). // Xb1 b1. // Position block 2 relative to block 1 b2.7 Example: Creating an attachment The following Java code fragment creates and positions the elements shown in the diagram above.getReportBody().addExpression(reYear).BOTTOM. Customizing Web Intelligence 109 . In this example. SectionContainer sc.createFreeCell(" "). cells and/or other sections. they are added to the right of the last one added. To check if a report cell is a section container use: ReportCell. the x and y co-ordinates’ parameters are in millimeters and are cast to the required type (double) using the “d” operator.MILLIMETER // Create block 1 (b1) as child of the ReportBody container ReportBlock b1 = report.setY(200d). ReportExpression reYear. one for Year and another for Country. ReportBlock c1 = report.isSection. by default.setAttachTo(b1. // Set the block’s position relative to its container b1.getAxis(). HAnchorType.NONE).

7 When you add an expression to the axis of a section. or three axes. In the example above. and content axes x. and z axes For a vertical table the report expressions are displayed in columns. For example. and graphs. two. For example. Block structure: axes and report expressions A block axis is an oriented collection of one or more report expressions. cross tables. forms. For a horizontal table the report expressions are displayed in rows. [Customer]. Report expressions are stored in the document dictionary when a query is executed. A section has one axis. A report expression is a report object or a variable. y. Creating and editing blocks Block is a generic name for tables. Sections and report blocks have axes. and are represented in REBean by the ReportExpression interface. Table 7-4 Structure of a vertical table Note: The block type determines the operators applied to the expression in the report. report cells for =[Year] and =[Country] are created. Block type vertical table horizontal table cross table graph Axes one horizontal axis one vertical axis horizontal. vertical. 110 Customizing Web Intelligence . A report block has one. The following table shows the axes for each type of block. in the above example the report expression [year] is shown in the table as NameOf([year]) and =[year]. a cell for the expression is automatically created.

Table 7-6 Structure of a cross table In a graph the report expressions are displayed as a picture with two or three dimensions.7 Table 7-5 Structure of a horizontal table For a cross table the report expressions are displayed in columns and rows with a shared body. Customizing Web Intelligence 111 .

// Create a new report ReportContainer report = doc. ReportExpression ctryExpr = dico. block.getChildByName("ParentYearID").getAxis (TableAxis. // Add the country object on the section axis section.createBlock (). // Create a section as the body report child SectionContainer section = body.getChildByname("ParentCountryID").createReport("My Report").addExpr (revExpr).addExpr(ctryExpr). block.HORIZONTAL).HORIZONTAL).getBodyReport().getAxis (TableAxis. ReportExpression revExpr = dico.createSection (). BodyReport body = report.getChildByName("ParentRevenueID"). 112 Customizing Web Intelligence .addExpr (yearExpr). // Retrieve the dictionary associated with the document // populated by the last call to Document.getAxis(). ReportExpression yearExpr = dico. // Add the Year and Revenue objects on the vertical axis of // the horizontal table.runQuery ReportDictionary dico = doc.7 Table 7-7 Structure of a graph Example: Building a report: adding expressions to axes The following code fragment builds a report structure by retrieving the report expressions from the document dictionary. // Create a block in the section container ReportBlock block = section.getDictionary().

Vertical and horizontal tables The header. You can change the following properties of the header. a cross table. Representing a block A block can be represented as a vertical or horizontal table. footer and body of a table with the Table interface: • • • visibility repetition decoration Customizing Web Intelligence 113 . or a graph. You can add breaks to report expressions belonging to an axis. Sorting report expressions You can sort report expressions into ascending or descending natural order. Breaks You can add breaks to report expressions. which contains TableCell objects. Vertical and horizontal tables use the SimpleTable specialization of Table. The natural order of an object is the one used in the database. The interface Representation defines how a block is represented. and you can show or hide the break’s header and footer using the BreakElement interface. The first element in the collection has the highest priority. the predefined calculation Sum adds the values of the report expression. a form.7 doc. For a percentage calculation. For example.applyFormat (). and use the name of the calculation as a label for the result. the results of a calculation are placed in the footer of a table. a Percentage column is also added. By default the first sort in the collection has the highest priority. Sorts are stored in a collection (Sorts) that defines the type and priority of the sort. Calculations You can add a calculation to a report expression. Breaks are stored in a collection. By default the header and footer are hidden. By default. footer and body of the table are exposed through the Table class as a CellMatrix collection.

and a set of interfaces that represent parts of the graph: Legend. override those of their parents. GraphAxisProperties. for example Body . Cross tables Cross tables use the CrossTable specialization of Table. Top . GraphAxisValues. Forms Forms are represented by the Form interface. Graph3D. Note: If you add a break to the report expressions in a cross table. The cells in the form are represented by a CellMatrix object.Right The zones correspond to parts of a cross table in structure view.Body) contains a division for each break.Left Bottom .Body Top . and Wall.Right Body .Body Bottom . each break has its own header and footer and each zone (except Body .Right Bottom .Left Top . and the cells in a cross table are grouped into zones. Graphs Graphs are represented by the Graph interface. Zones that can contain more than one cell.Left Body . 114 Customizing Web Intelligence . contain a matrix of TableCell objects that are contained in the collection CellMatrix. GraphData.Body.Body Body . GraphTitle.7 The settings on low level objects are inherited from their parents but. Developer Suite supports the following graphs. if changed. and you can set the decoration of labels and values separately.

7 Graph category Bar Graph type Vertical Grouped Horizontal Grouped Vertical Line and Bar Horizontal Line and Bar Vertical Stacked Horizontal Stacked Vertical Percent Horizontal Percent 3D Vertical Mixed Horizontal Mixed Vertical Stacked Horizontal Stacked Vertical Percent Horizontal Percent 3D 3D Surface Vertical Absolute Horizontal Absolute Vertical Stacked Horizontal Stacked Vertical Percent Horizontal Percent 3D Area 3D Surface Pie Doughnut 3D Pie 3D Doughnut Stacked Area Radar Polar Scatter Radar Line Line Area Pie Radar & Scatter Customizing Web Intelligence 115 .

Attributes and Font. For example. Using this interface you can set properties such as the background and foreground image. There are two types of cell: free cell. style. Font The Font interface allows you to determine the color. Alignment Using the Alignment interface you can set the horizontal and vertical alignment of the cell contents. color. Report cells contain a formula of a section axis and are exposed with the class ReportCell. size and font name of the text in the cell. For more information on containment rules see “Representing document structure through containment” on page 106. and the properties of the cell border (which is represented by the interface Border). The Decoration interface provides a gateway for other interfaces such as Alignment. the font. 116 Customizing Web Intelligence . Creating and editing the page decoration Page decoration refers to the display aspects of the contents of a cell. or the heading of a section. Attributes The Attributes interface represents the “non-font” aspects of the cell’s presentation. and size of the text in the cell. Free cells contain a string and are exposed with the class FreeCell. and report cell.7 Creating and editing cells A cell is a report element that contains information such as the title of the report. You can add a cell to all the elements contained in a report element. You can also set the wrapping properties of text in the cell. You can control the decoration of most cells in a report using the Decoration interface. the color of the foreground and background.

or inches. and Letter. A4 to A0. displaying calculations and breaks. or portrait views. Customizing Web Intelligence 117 . repeating blocks on every page. The classes give you control over how blocks behave around page breaks. and orient the page in landscape. All the margins are adjustable and you can set the units to millimeters. and hiding and showing the elements of a report. Paper size You can set the page size for the document to the following paper sizes: Custom. Visibility and Repetition classes.7 Page layout You can control the page layout of a report using the PageLayout.

7 118 Customizing Web Intelligence .

Customizing Web Intelligence Working with Recordsets chapter .

The exceptions to this are DataProvider. Each row can be considered a record (or a set of fields) and you can access only one record at a time.getColumnName(n) gives the name of the nth field in the current record.0 70. Field names Recordset. You can find the names listed under the method descriptions in the Web Intelligence SDK Online Reference.0 recordset fields Each recordset is divided into rows and columns.0 40.0 20. This chapter explains how to use the recordset classes of the Web Intelligence SDK.0 50. a field current record d g j m p s b e h k n q t c f i l o r u 10. a group of objects. or contained in. Recordsets in REBean In REBean the Recordset class represents recordsets.8 Overview Web Intelligence SDK often uses the recordset data structure for storing information such as the results in a data provider.0 30.getResult which returns a recordset in which the names of the fields are the names of the results (columns) of the query. Anatomy of a recordset In Web Intelligence SDK recordsets provide a generic way of representing the data about.0 60. The names of the fields in most recordsets are fixed. 120 Customizing Web Intelligence .

getCellObject and provide the index of the column in which you are interested.append("String"). // 0: assume query has one flow rs.first or Recordset. To access the fields of a record.getColumnType(i).class) ) sbt.").1) respectively.getRow -1).append("Date").previous moves to (Recordset.append(".8 Moving around the recordset Recordset can contain only one record (row) at a time.equals(Date. You can set the direction to FORWARD (default) or REVERSE. use Recordset.getResult(0). // Print the column types.class) ) sbt.isFirst to control loops that move through recordsets.equals(String.getRow + 1) and when it is set to REVERSE calling Recordset.class) ) sbt. next.getColumnCount().last before you start processing a recordset so that you know which row the Recordset object contains. Accessing the value of a field In REBean you can access the values of a field directly. It is good practice to set the direction and call Recordset.first and Recordset. i < rs. for (int i = 0. } // Print the recordset contents: column names and data Customizing Web Intelligence 121 . if ( c. You can use Recordset.last do not depend on the direction and always move to row 0 and row (Recordset. String.equals(Integer. if ( c. // or moves to (Recordset. StringBuffer sbt = new StringBuffer(). When the direction is set to FORWARD calling Recordset. last. They can be Integer. previous.first(). and setRow The Recordset class has a feature for setting the direction. To load it use the move methods of Recordset: • first.getColumnCount . i++) { Class c = rs. sbt.append("Integer").isLast and Recordset.println(sbt. Example: Accessing the values in a recordset The following Java code fragment prints the types of the columns and the contents of the results of a query contained in a data provider. System. Recordset rs = dp. Recordset. if ( c.out.toString()).

getCellObject(k).append(".out. sbn.append(".isLast()) { // column names StringBuffer sbn = new StringBuffer(). k< rs.getDirection equals FORWARD. j++) { sbn. } System. } System.append( rs. and that the data provider (dp) has been populated.println(sbn. j < rs. for (int j = 0. For more information on populating data providers see “Executing queries and retrieving the data” on page 102.toString() ).toString()). 122 Customizing Web Intelligence .append( rs."). sbd. k++) { sbd.").println(sbd.out.getColumnCount().8 while (!rs.getColumnCount(). This code fragment assumes that rs. // data for (int k= 0. } rs.toString() ).next().getColumnName(j).toString()).

Migrating Business Objects 6 Customized Applications to BusinessObjects XI

Business Objects Information Resources



Documentation and information services

Documentation and information services
Business Objects offers a full documentation set covering its products and their deployment. Additional support and services are also available to help maximize the return on your business intelligence investment. The following sections detail where to get Business Objects documentation and how to use the resources at Business Objects to meet your needs for technical support, education, and consulting.

You can find answers to your questions on how to install, configure, deploy, and use Business Objects products from the documentation.

What’s in the documentation set?
View or download the Business Objects Documentation Roadmap, available with the product documentation at The Documentation Roadmap references all Business Objects guides and lets you see at a glance what information is available, from where, and in what format.

Where is the documentation?
You can access electronic documentation at any time from the product interface, the web, or from your product CD.

Documentation from the products
Online help and guides in Adobe PDF format are available from the product Help menus. Where only online help is provided, the online help file contains the entire contents of the PDF version of the guide.

Documentation on the web
The full electronic documentation set is available to customers on the web from support website at:

Documentation on the product CD
Look in the docs directory of your product CD for versions of guides in Adobe PDF format.

124Migrating Business Objects 6 Customized Applications to BusinessObjects XI

Customer support, consulting and training


Send us your feedback
Do you have a suggestion on how we can improve our documentation? Is there something you particularly like or have found useful? Drop us a line, and we will do our best to ensure that your suggestion is included in the next release of our documentation: Note: If your issue concerns a Business Objects product and not the documentation, please contact our Customer Support experts. For information about Customer Support visit: support.

Customer support, consulting and training
A global network of Business Objects technology experts provides customer support, education, and consulting to ensure maximum business intelligence benefit to your business.

How can we support you?
Business Objects offers customer support plans to best suit the size and requirements of your deployment. We operate customer support centers in the following countries:

• • • • •

USA Australia Canada United Kingdom Japan

Online Customer Support
The Business Objects Customer Support website contains information about Customer Support programs and services. It also has links to a wide range of technical information including knowledgebase articles, downloads, and support forums.

Migrating Business Objects 6 Customized Applications to BusinessObjects XI125

businessobjects. Find more information on the Business Objects Education website: Looking for training options? From traditional classroom learning to targeted e-learning seminars. contact your local sales 126Migrating Business Objects 6 Customized Applications to BusinessObjects XI . Expertise is available in relational and multidimensional databases.businessobjects. customized embedding technology. consulting and training Looking for the best deployment solution for your company? Business Objects consultants can accompany you from the initial analysis stage to the delivery of your deployment project. database design tools. For more information.9 Customer support. in connectivities. or contact us at: http://www. we can offer a training package to suit your learning needs and preferred learning style. and more.

and online forums. Business Objects product Online Customer Support http://www. Information on how Business Objects can help maximize your business intelligence investment.businessobjects.Useful addresses at a glance 9 Useful addresses at a glance Address Business Objects product information http://www. Information on Business Objects training options and support/ Business Objects Consulting Services http://www.businessobjects. as well as links to technical articles. Product documentation http://www.businessobjects. Migrating Business Objects 6 Customized Applications to BusinessObjects XI127 .com/ support Business Objects Documentation mailbox documentation@businessobjects. including the Business Objects Documentation Roadmap. Information on Customer Support services/consulting/ Business Objects Education Services services/training Content Information about the full range of Business Objects products. Send us feedback or questions about documentation.

9 Useful addresses at a glance 128Migrating Business Objects 6 Customized Applications to BusinessObjects XI .

127 C calculations 113 categories 39–47 category details 46 category moving 46 creating 45 deleting 45 getting details 46 renaming 45 user rights.Index A accessing user profiles 25 actions drilling 85 Adobe Acrobat 34 see also PDF alignment 116 anchors vertical and horizontal 108 applets Web Intelligence Java Report Panel 94 area graph 114 attachments 108 authentication passwords 19 axis (block) 110 training services 126. and 39 categorizing documents 39 cells creating 116 CESDK creating a ISessionMgr object 18 referencing 17 CESDK object creating 20 chunking lists of values 74 classes referencing 17 closing ReportEngine object 32 Web Intelligence sessions 20 colors 116 conditions 100 prompts 101 structure 101 consultants. 127 support services 125 Customizing Web Intelligence 129 . Business Objects 126 contexts opening documents 48 cookies sending with JSP 20 creating blocks 110 B background 116 bar graph 114 batched lists of values 74 blocks cells 116 creating 110 cross tables 114 forms 114 graphs 114 repeating 117 representing 113 borders 116 breaks 113 browsers storage tokens 38 building data providers 91 Business Objects consulting services 126.

75 document lists 49 report maps 77 saving 50 sending 52 structure 104 types 34 Web Intelligence format 31. and 88 displaying document lists 48 report maps 77 document structure 104 attachments 108 blocks 110 positioning elements 108 report expressions 109 sections 109 documentation feedback on 125 on product CD 124 on the web 124 roadmap 124 documents 50 see also reports categories 39 changing names 50 creating 104 dictionaries 93 displaying document lists 48 drillable 81 drilling 79 opening 13. 48 prompts 66 properties 58 refreshing 14. 83 drill bars 83. 83. 87 hierarchies 82. 89 drill hierarchies 82 drill mode 81. 84 images 87 Customizing Web Intelligence 130 . 85 filtering 89 generating HTML 82.categories 45 cells 116 document structure 104 ISessionMgr object 18 ReportEngine object 31 sections 109 cross tables 114 custom 58 customer support 125 D data providers 91–102 building 94 data sources 92 executing queries 102 data sources 92 decoration pages 116 deleting categories 45 Developer Suite migration 11 dimensions drilling 82. 82 entering and leaving 83 drill options 84 drill path 81. 66. 83. 83 setting 81. 85 drilling 79–90 actions 85 dimensions 82 drill bars 83 drill hierarchies 83 drill mode 81. 87 drill path 81. 81. 85 scope of analysis. 83. 85 hyperlinks 81.

89 drill-by and drill-up actions 86 queries 100 query conditions 89 fonts 116 foreground 116 formats saving 50 formatting layout 117 I images drilling 87 importing code in JSP 24 include directive in JSP 24 information resources 124 InfoView example workflows 13 user profiles 25 Introduction 9 Customizing Web Intelligence 131 . See training Enterprise Mode authentication 19 errors 30 exceptions 30 executing queries 102 G getHTMLView 36 drilling 82. 81. 87 getting started 11. 83. 87 F feedback. on documentation 125 fields recordsets 120 filtering drill bars 83. 82. 81. 88. 83. 16 graphs 114 H handling context prompts 76 exceptions 30 out of scope drill requests 88 prompts 66 hello world example 16 hierarchies drilling 83.Java script files 87 overview 80 query string parameters 81. 84 scope of analysis 82. 85 hyperlinks generating for drilling 81. 84. 99 setting parameters 86 slice 85 snapshots 90 transparent drill out of cube 82 Web Intelligence reports 83–90 page decoration 116 paper size 117 reports 103 forms 114 free cells 116 E editing blocks 110 cells 116 data providers 91 document structure 104 queries 98 sections 109 education.

58 JSP importing code 24 reading a user profile 26 sending cookies 20 reports 77 nested prompts 74 NT Challenge Mode authentication 20 O objects query results 99 Online Customer Support 125 opening documents 13.Properties 26. 99 L landscape layout 117 layout 117 line graph 114 listing documents 48 lists of values 70–76 batched 74 chunking 74 constrained prompts.Properties 58 page layout 117 page decoration 116 paper size 117 passwords 18 storage token 36 PDF displaying Web Intelligence reports 62 output format 64 .util.pdf see PDF pie chart 115 portrait layout 117 prompts 66–76 conditions 101 constrained 71 context 66.util. 76 drilling 89 entering values 72 lists of values 70 multicolumn lists of values 72 multivalued 71 nested 74 storage tokens 36 M managing documents 34 Microsoft Excel displaying Web Intelligence reports 62 output format 64 migration 11. 48 out of scope drills 82. 50 multivalued prompts 71 N navigating Customizing Web Intelligence 132 . 88. and 71 displaying 70 multicolumn 72 prompts in (nested) 74 refreshing 75 log in and log out 16 logins 18 LOV see lists of values P packages java.J Java Report Panel see Web Intelligence Java Report Panel Java script files drilling 87 java.

84 R radar & scatter graph 115 REBean building data providers 91 creating a ReportEngine object 31 document properties 58 exceptions 30 features 10 formatting reports 103 prompts 66 RECOM creating a ReportEngine object 31 prompts 66 RECOM. and 20 sessions closing 20 creating 20. 87 filters 89 formatting 103–117 report maps 77 viewing all the reports in a document 62 repository opening documents 48 sending documents 52 resolving universe contexts 76 resources 124 result objects 99 running queries 102 S save to corporate see publishing saving documents 50 scope of analysis 80.dll 31 recordsets 119–122 changing records 121 fields 120 referencing CESDK 17 Web Intelligence SDK classes 17 refreshing document lists 49 documents 14. 110 adding to axes 112 breaks 113 calculations 113 sorting 113 report maps 77 snapshots. 66. 99 handling manually 88 scripts drilling 87 sections creating 109 sending documents 52–54 session ID cookies. and 90 Report Panel see Web Intelligence Java Report Panel ReportEngine object 31 closing 32 reports drilling 79. 75 lists of values 75 renaming categories 45 RENET exceptions 30 features 10 report expressions 109. 82. 48 Customizing Web Intelligence 133 . 83. 83. 81. 81. 58 documents 58 Q queries 92 editing 98 executing 102 query conditions 89. 100 query strings drilling 81.

on Business Objects products 126 transparent drill out of cube 82 traversing categories 41 report maps 77 triggers generating storage tokens 35 U universes 92 resolving contexts 76 Customizing Web Intelligence 134 . 48 accessing 25 adding to 29 setting 28 user rights 48 categories. for 39 transparent drill out of cube 82 user sessions see Web Intelligence sessions V values prompts 70 viewing binary view 62 Web Intelligence reports 61–78 W web customer support 125 getting documentation via 124 useful addresses 127 Web Intelligence documents building data providers 91 formatting reports 103 saving 50 sending 52 Web Intelligence Java Report Panel 94 launching 94 Web Intelligence SDK creating a ISessionMgr object 18 exceptions 30 features 34 hello world 16 login 18 migration 11 packages 10 referencing classes 17 T tables cross tables 114 vertical and horizontal 113 technical support 125 temporary files storage tokens 35 training.setting drill actions 85 drill parameters 86 user profiles 28 settings in user profiles 25 slice drill action 85 snapshots 90 SQL executing 102 storage tokens advantages 38 browser navigation 38 generation triggers 35 life cycle 35 opening documents 48 viewing reports 62 support customer 125 locations 125 technical 125 web site 125 user names 18 user profiles 25.

Index Web Intelligence sessions closing 20 creating 48 storage tokens 38 web sites support 125 training 126 Customizing Web Intelligence 135 .

Index 136 Customizing Web Intelligence .

Sign up to vote on this title
UsefulNot useful