You are on page 1of 58

Desktop Intelligence Developer Guide

BusinessObjects Enterprise XI R2
Patents 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.

Trademarks 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.

Copyright Copyright © 2005 Business Objects. All rights reserved.

Third-party Business Objects products in this release may contain redistributions of software licensed
contributors from third-party contributors. Some of these individual components may also be available
under alternative licenses. A partial listing of third-party contributors that have requested or
permitted acknowledgments, as well as required notices, can be found at:
http://www.businessobjects.com/thirdparty
Contents
Chapter 1 Introduction 7
About this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Who should read this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Business Objects information resources . . . . . . . . . . . . . . . . . . . . . . . . 8

Chapter 2 Getting Started with VBA 9


Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Accessing the Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . 10
Language Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Implementing Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Declaring an array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Array indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
With Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
The VBA Object Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Including External Object Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Some Useful VBA Functions and Statements . . . . . . . . . . . . . . . . . . . . . . 14

Chapter 3 Programming with Desktop Intelligence 17


Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Macros and Sub-routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Creating a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
The Visual Basic Tool Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Adding macros to the Visual Basic tool bar . . . . . . . . . . . . . . . . . . 20
Add-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Desktop Intelligence Developer Guide 3


Contents

Creating an Add-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Installing an Add-in Using the Interface . . . . . . . . . . . . . . . . . . . . . . . . 22
Desktop Intelligence Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Event Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Notes on the order in which events occur . . . . . . . . . . . . . . . . . . . 23
Implementing an Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Implementing Application Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Chapter 4 Customizing the User Interface 27


Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Understanding the User Interface Classes . . . . . . . . . . . . . . . . . . . . . . . . . 28
Command Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
The CmdBarControls collection . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Nested controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Adding a Command Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Displaying Pop-up Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Adding Controls to a Command Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Adding Faces to Buttons: the Clipboard Object . . . . . . . . . . . . . . . . . . 33
Procedure: adding a face to a button . . . . . . . . . . . . . . . . . . . . . . . 33
Useful tips for adding buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Adding Actions to Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Creating Your Own Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Chapter 5 Data Providers 37


Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Working with Existing Data Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Types of Data Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Query technique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Freehand SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Personal text file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
VBA procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4 Desktop Intelligence Developer Guide


Contents

Loading and Unloading a Data Provider . . . . . . . . . . . . . . . . . . . . . . . 41


Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Creating a Query Technique Data Provider . . . . . . . . . . . . . . . . . . . . . . . . 42
Building the query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Running and refreshing the query (filling the microcube) . . . . . . . 43
Creating a VBA Procedure Data Provider . . . . . . . . . . . . . . . . . . . . . . . . . 43
Defining a VBA Procedure Data Provider . . . . . . . . . . . . . . . . . . . . . . 43
Defining a VBA procedure data provider with the SDK . . . . . . . . . 44
The DpVBAInterface Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Using a VBA Procedure Data Provider . . . . . . . . . . . . . . . . . . . . . . . . 45
The difference between running and refreshing . . . . . . . . . . . . . . 46
Bypassing the wizards with AddDPVBA . . . . . . . . . . . . . . . . . . . . 46
Sharing a VBA Data Provider as an Add-in . . . . . . . . . . . . . . . . . . . . . 47

Appendix A Business Objects Information Resources 49


Documentation and information services . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
What’s in the documentation set? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Where is the documentation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Documentation from the products . . . . . . . . . . . . . . . . . . . . . . . . . 50
Documentation on the web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Documentation on the product CD . . . . . . . . . . . . . . . . . . . . . . . . 50
Send us your feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Customer support, consulting and training . . . . . . . . . . . . . . . . . . . . . . . . . 51
How can we support you? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Online Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Looking for the best deployment solution for your company? . . . . . . . 52
Looking for training options? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Useful addresses at a glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Index 55

Desktop Intelligence Developer Guide 5


Contents

6 Desktop Intelligence Developer Guide


Desktop Intelligence Developer Guide

Introduction

chapter
1 Introduction
About this guide

About this guide


This guide explains how to develop using the Desktop Intelligence SDK.

Who should read this guide


This guide is intended for developers that want to use the Desktop
Intelligence SDK.

Business Objects information resources


For more information and assistance, see Appendix A: Business Objects
Information Resources. This appendix describes the Business Objects
documentation, customer support, training, and consulting services, with links
to online resources.

8 Desktop Intelligence Developer Guide


Getting Started with VBA

chapter
2 Getting Started with VBA
Overview

Overview
You can use Microsoft Visual Basic for Applications (VBA) to create custom
macros and add-ins in Desktop Intelligence. Because VBA is also used by
Microsoft Office products and by an increasing number of other Windows
software products, you can integrate and customize applications already
available on the user’s desktop.
Comprehensive on-line help about the VBA development environment and
language is available from the VBA Help menu and when you press F1 in the
VBA development environment.
This chapter provides an overview of how VBA gives you the power to extend
the capabilities of Desktop Intelligence. This chapter also describes how you
can develop macros and add-ins using VBA to control the Desktop
Intelligence and Designer environments, as well as perform queries and
analysis on data in documents through universes and data providers.

Accessing the Development Environment


Desktop Intelligence contains a Visual Basic editor which you can use for
developing macros, add-ins, and VBA data providers. You can access the
Visual Basic editor from the Visual Basic tool bar. If this is not visible, right-
click on a tool bar or menu bar and select Visual Basic. You can also access
the Visual Basic editor from the Macros submenu on the Tools menu.

The Visual Basic editor is the standard Microsoft VBA editor which is included
with Microsoft Office 2000. So, you can use tools such as Object Browser and
Project Explorer. On-line help for VBA is also available from the editor.

10 Desktop Intelligence Developer Guide


Getting Started with VBA
Language Summary 2
Language Summary
Following is a very brief summary of the VBA language aimed at illustrating
some of the key features of the language to get you started.
For details on Visual Basic and VBA consult the Microsoft documentation.

Variables
VBA supports the following data types: Boolean, Byte, Integer, Long, Single,
Double, Currency, Date, Object, String, Variant and user-defined.
You declare variables using the Dim keyword. For example:
Dim Name As String

Procedures
VBA provides two different type of procedures: functions, and sub-routines.
Functions can return values, sub-routines have no return value.

Implementing Events
VBA is event-driven. That is, the model for VBA is that your code is executed
when certain events in the application take place. Examples of events are a
user opening a document, and a user clicking on a button. The code that
executes when an event is triggered is called the implementation of the event.
Note that the Universe Designer SDK does not have any events to
implement. This means that you cannot write code to respond to events in the
Designer application. You can, however, use the Designer object model in the
implementation of the events of other applications.
For more information on implementing events see “Desktop Intelligence
Events” on page 23 and “Creating Your Own Forms” on page 34.

Desktop Intelligence Developer Guide 11


2 Getting Started with VBA
Language Summary

Flow Control
The following list describes the most commonly used VBA flow control
structures.

Control Description
If-Then-Else Tests a condition and alters the execution flow based on the
results of the test
For-Next Carries out a repetitive action a specific number of times
While-Wend Carries out a repetitive action while a condition is true
Do-Loop Carries out a repetitive action either while a condition is true or
until it becomes true
Select-Case Branches to one of several possible code segments based on
the value of a variable or the outcome of a test
For-Each-Next Performs a repetitive action on each object in a collection or on
each item of an array

Arrays
An array is a variable that contains multiple values. Each value is indexed and
all the elements of the array have the same data type.
VBA supports multi-dimensional arrays.

Declaring an array
To declare an array in VBA use the following syntax.
Dim ArrayName(n, m, ..., z) As DataType
n, m, …, z are integers that represent the size of a dimension. In VBA you can
declare an array with up to 60 dimensions.
Example: Declaring a two dimensional array
The following VBA code fragment declares an array with two dimensions. The
size of each dimension is determined by the constant MAX_CUSTOMERS.
Const MAX_CUSTOMERS As Integer = 500
Dim customers(MAX_CUSTOMERS, MAX_CUSTOMERS) As String

Array indexes
By default the first element of an array is element zero and the last is n. You
can change this using Option Base statement.

12 Desktop Intelligence Developer Guide


Getting Started with VBA
Language Summary 2
Option Base statement
The Option Base statement enables you to set the lower bound of all arrays to
either one or zero.
Option Base 1
Array(1) ‘reference the first element
Is the same as:
Option Base 0
Array(0) ‘reference the first element
Array indexing that starts at a number other than 1 or 0
If you want the index of an array to start at a number other than 1 or 0, you
can specify the bounds you want in the array declaration. For example:
Dim RawData(10 To 20) As Variant
RawData has 11 elements. The first is element number 10, the last is element
number 20.

With Statement
The With statement is a useful tool for abbreviating object references.
Example: Using a With statement in an object reference
The following code fragment sets the properties of an object using the With
statement.
With
Application.ActiveDocument.DataProviders.Item(1).Queries
.DuplicateRows = TRUE
.DeleteTrailingBlanks = TRUE
.ScopeOfAnalysis = boThreeLevelsDown
End With

Error Handling
You can use the statement On Error to handle errors generated during
execution.
If you don't use an On Error statement, any run-time error that occurs is fatal.
That is, an error message is displayed and execution stops.
Example: Handling errors with the On Error statement
Sub Convert(...)
On Error Goto ErrorDisplay
... ’if an error occurs here go to ErrorDisplay
Exit Sub
ErrorDisplay: MsgBox Err.Number & "-" & Err.Description

Desktop Intelligence Developer Guide 13


2 Getting Started with VBA
Some Useful VBA Functions and Statements

Sub End

You can also ignore errors with the following statement:


On Error Resume Next
Be careful when using this statement however, as it can hinder debugging.

The VBA Object Browser


The VBA development environment has a number of tools to help you run,
debug and move around your code. One of the most useful of these is the
Object Browser.
The Object Browser shows you all the programmable objects that are
installed and registered on your system along with their associated
properties, methods and events. You can also use the Object Browser to
browse the procedures and module-level variables in your own VBA projects.
To open the Object Browser:
• Select Object Browser from the View menu.

Including External Object Libraries


To access the object models of other products, for example Designer or
Microsoft Outlook, from your VBA program you need to create a reference to
the appropriate object library.
After creating the reference you can use the classes, methods and properties
provided in the object model you reference.
To refer to an external object library from VBA:
1. Select References… from the Tools menu.
2. Select the object library from the list and click OK.
If the reference was successful the name of the object library you referenced
appears in the Object Library drop down in the VBA Object Browser.

Some Useful VBA Functions and Statements

Name Description
Abs Returns the absolute value of a number
CurDir Returns the current MS-DOS path

14 Desktop Intelligence Developer Guide


Getting Started with VBA
Some Useful VBA Functions and Statements 2
Name Description
Chr Returns a character given its ASCII code
Date Returns the current system date
Exit Do Causes execution to break out of a Do loop
Exit For Causes execution to break out of a For Next loop
Exit Function Causes execution to break out of a function
Exit Sub Causes execution to break out of a sub-routine
Fix Returns the integer portion of a number, rounding
down positive numbers and rounding up negative
numbers
Int Returns the integer portion of a number, rounding
down positive numbers and negative numbers
IsArray Returns TRUE if an expression is an array
IsDate Returns TRUE if an expression is a date
IsEmpty Returns TRUE if no value has been assigned to a
variable
IsError Returns TRUE if an expression is an error value
IsNull Returns TRUE if an expression evaluates to
NULL
IsNumeric Returns TRUE if an expression evaluates to a
number
IsObject Returns TRUE if an expression represents an
object
LBound Returns the lower bound of an array
Len Returns the length of a string or the number of
bytes required to store a value
Now Returns the current date and time
Shell Runs an executable program
Sqr Returns the square root of a number
StrComp Performs a string comparison
Time Returns the current system time
TypeName Returns the data type of a variable
Ubound Returns the upper bound of an array

Desktop Intelligence Developer Guide 15


2 Getting Started with VBA
Some Useful VBA Functions and Statements

16 Desktop Intelligence Developer Guide


Programming with Desktop
Intelligence

chapter
3 Programming with Desktop Intelligence
Overview

Overview
This chapter explains how to program with Desktop Intelligence.
It covers the following topics:
• Macros and Sub-routines
• Add-ins
• Desktop Intelligence Events
• Implementing Application Events

Macros and Sub-routines


You can write macros in Desktop Intelligence using the integrated VBA
environment. A macro is a series of commands and functions which automate
tasks that you need to perform regularly. A macro is saved with a document
and is enabled each time you open the document.
You can send a document containing a macro to other users, just as you
would send a regular Desktop Intelligence document.

Creating a Macro
The procedure for creating a macro is as follows:
1. Select Macro from the Tools menu.
2. On the submenu, select Macros. The Macros dialog box appears:
In the Macros dialog box, you can display the names of add-ins, or the
macros contained in the open document, or a combination of both.
1. Enter a name for the macro and click Create. The VBA environment is
opened and a module containing a skeleton subroutine for your macro is
created.
2. You can now begin writing your macro.
When your macro is complete, and compiles successfully, you should select
Close and Return to Desktop Intelligence from the File menu. You can now
run the macro from the Macros dialog box. If you wish, you can also associate
your macro with a button on the tool bar. This procedure is described in ‚
“Customizing the User Interface”.

18 Desktop Intelligence Developer Guide


Programming with Desktop Intelligence
Macros and Sub-routines 3

Run
selected
macro
Debug selected
macro
List of Edit selected
available macro
macros
Delete
selected macro
Show macros
contained in Add a
selected item description for
the selected
macro

The Visual Basic Tool Bar


You can hide or show the Visual Basic tool bar in Desktop Intelligence by
right-clicking another tool bar or the menu bar and selecting Visual Basic. You
can also select Toolbars from the View menu.
The Visual Basic tool bar contains the following buttons:
• Run Macro. Click this button to browse for and run a macro.

Desktop Intelligence Developer Guide 19


3 Programming with Desktop Intelligence
Macros and Sub-routines

Run Macro Run Associated Macro

Visual Basic
Editor

• Visual Basic Editor. Click this to open the VBA environment for editing a
procedure or macro.
• Run Associated Macro. Click this button to run a macro associated with
this button.

Adding macros to the Visual Basic tool bar


You can have up to five buttons with associated macros on the Visual Basic
tool bar. To associate a macro with a button:
1. Click Options on the Tools menu.
2. Click the Macros tab in the Options dialog box.
The panel below is displayed:

3. Click the check box beside the number of the button with which you wish
to associate the macro.

20 Desktop Intelligence Developer Guide


Programming with Desktop Intelligence
Add-ins 3
4. Type the name of the macro in the text box to the right. Alternatively, you
can click the Browse button beside the textbooks to select a macro.
When a macro has been selected, the edit box displays
AddIn.rea!module.macro or Document.rep!module.macro.
5. If you wish, you can enter a tool tip for the macro.
6. Click OK.
When a button has an associated macro it no longer appears grayed on the
tool bar. The macro details are now hidden from the user who can run the
macro by clicking the respective button on the Visual Basic tool bar.

Add-ins
Add-ins are programs that give optional commands and features to Desktop
Intelligence. They are saved with the extension .rea.
Before you can use an add-in, you must load it on your computer and then
install it in Desktop Intelligence. Once you install an add-in, it remains there
each time you launch Desktop Intelligence.
To conserve memory, uninstall add-ins you do not use often. Uninstalling an
add-in removes its features and commands from Desktop Intelligence, but the
add-in program remains on your computer so you can easily install it again.
Unlike macros, add-ins are not associated with a single document—once
installed, an add-in will function just like any other feature of the Desktop
Intelligence application.
You can distribute add-ins you have created to other users and retrieve and
use add-ins that others have created.

Creating an Add-in
You can create add-ins in Desktop Intelligence, and distribute them to other
users or save them to BusinessObjects Enterprise.
To create an add-in:
1. Create a new document.
2. Open the VBA editor.
3. Write and compile the add-in.
4. Select Close and Return to Desktop Intelligence from the File menu.
5. From the File menu select Save As...
6. Select Desktop Intelligence Addins (*.rea) from the Save as type list box.

Desktop Intelligence Developer Guide 21


3 Programming with Desktop Intelligence
Add-ins

You can now distribute your add-in to other users.


When you save your document as an add-in a copy of the document is saved.
If you make further changes, you must use Save As rather than Save to
update the saved add-in.
Tip:
To get the best performance from your system, use one large .rea file
containing many subroutines, rather than using multiple .rea files.

Installing an Add-in Using the Interface


To install an add-in you must save it on your computer and then install it in
Desktop Intelligence. The procedure is as follows:
1. Save the add-in on your computer.
2. Select Add-Ins from the Tools menu in Desktop Intelligence.
The Add-Ins dialog box opens:
Click a
check box
to load add-
in Browse for an
add-in
Add-ins
installed on
your
computer

3. Click the check box of the add-in you wish to install. If it is not visible in
the Add-Ins dialog box, you can search for it by clicking the Browse
button.
4. Click OK.
You can run an installed add-in from the Macros dialog box, or you can
associate it with a button on the Visual Basic tool bar. This procedure is
described in ‚ “Customizing the User Interface”.

22 Desktop Intelligence Developer Guide


Programming with Desktop Intelligence
Desktop Intelligence Events 3
Desktop Intelligence Events
An event is a change in the state of Desktop Intelligence for which you can
program a response. For example, you can program Desktop Intelligence to
display a dialog box whenever a user opens a document. Programming a
response to an event is called implementing the event.
In Desktop Intelligence you can implement events concerning Desktop
Intelligence documents (*.rep and *.rea). These events are made available to
you in general and specific senses. That is, you can implement an event for
any document, or only when it happens to a particular document.
General document events, those that apply to any document, belong to the
Application class and are called application events.
Specific document events, those that apply to a specific document, belong to
the Document class and are called document events.
You can implement the following Desktop Intelligence events.

Application events Document events


DocumentActivate Activate
DocumentAfterRefresh AfterRefresh
DocumentBeforeClose BeforeClose
DocumentBeforeRefresh BeforeRefresh
DocumentBeforeSave BeforeSave
DocumentDeactivate Deactivate
DocumentOpen Open
NewDocument

Event Triggers
Events can be triggered by user actions or by use of methods in the Desktop
Intelligence SDK. For example, a BeforeRefresh event (application and
document) is triggered by the user clicking the Refresh button in the Desktop
Intelligence user interface, or by a call to the Document.Refresh method.

Notes on the order in which events occur


• Document events are triggered before Application events.
• BeforeClose occurs before BeforeSave.

Desktop Intelligence Developer Guide 23


3 Programming with Desktop Intelligence
Desktop Intelligence Events

• If the focus is moved from Doc1 to Doc2, the order of events is


Doc1_Deactivate followed by Doc2_Activate.
• When a document is opened, two events are triggered: Open followed by
Activate.

Implementing an Event
Each event that you can implement appears in the VBA procedure list for its
corresponding object.
Object Procedure

Document events
Implementation of the BeforeSave Document event:
Document_BeforeSave()

To implement an event, insert the code that you want to execute when the
event occurs in the procedure corresponding to the event.
This process is the same as the one for implementing form events in the user
interface. See “Creating Your Own Forms” on page 34.
Example: Implementation of the DocumentBeforeRefresh event
The following code could be useful for a document that will take a long time to
refresh.
Private Sub Document_BeforeRefresh(Cancel As Boolean)
Dim Response As Variant'user’s response to the message

Response = MsgBox("Are you sure you want to refresh?",


vbOKCancel)

If Response = vbCancel Then


Cancel = True'user chose cancel, so cancel the refresh
Else

24 Desktop Intelligence Developer Guide


Programming with Desktop Intelligence
Implementing Application Events 3
Cancel = False'user didn't cancel, so continue with
refresh
End If
End Sub

Implementing Application Events


You cannot implement application events directly. To access the events of the
Application object you need to create a reference to the object and implement
the events of the reference.
To create a reference to the Application object:
1. Create a class module in VBA.
2. In the definition of the class you create, include a property of type
“Application”. Declare the property as “Public” and “WithEvents”.
The property (reference) you create appears in the object drop-down list
of the code window of the class you create.
3. In a module create an object of the type you created in step 1.
4. In a sub-routine set the variable’s Application property to the Application
object.
The sub-routine must execute before your implementation of the
application events are triggered.
5. You can now implement the events of the reference to the Application
object.
The events for the application reference property appear in the procedure
drop-down list of the code window of the class module you created in
step 1.
The diagram below illustrates these steps.
The events for the application reference property (boapp) appear in the
procedure list of the application reference class (AppRefClass).
Example: Accessing the events of the Application object
The following code fragments show the VBA statements you need to
establish a reference to the Application object. Once you have established
this reference, you can implement application events.
In a VBA class module called AppRefClass, for example, declare an
Application property called, for example, boapp:
Public WithEvents boapp As Application

Desktop Intelligence Developer Guide 25


3 Programming with Desktop Intelligence
Implementing Application Events

1 AppRefClass
Application
Create • boapp As Application 2
class

Set reference
Create 4
3 object

AppRef 5
• boapp Private Sub
boapp_DocumentOpen(
Implement
‘whenever a document is
event opened
MsgBox "Are you
ready?"
End Sub

The Public part of the declaration makes the property globally available. The
WithEvents part of the declaration gives you access to the events defined for
the Application class. For more information on the Public and WithEvents key
words refer to the Visual Basic documentation.
In another module create an instance of AppRefClass called, for example,
AppRef:
Dim AppRef As New AppRefClass
Then, in a sub-routine set AppRef.boapp:
Sub Initialize()
Set AppRef.boapp = Application
...
End Sub
Now, the events of the Application object can be implemented using
AppRef.boapp.

26 Desktop Intelligence Developer Guide


Customizing the User
Interface

chapter
4 Customizing the User Interface
Overview

Overview
This chapter explains how to customize the User Interface with the Desktop
Intelligence SDK.
It covers the following topics:
• User Interface Classes
• Adding a Command Bar
• Adding Controls to a Command Bar
• Creating Forms.

Understanding the User Interface Classes


Some programs you write require input from a user or need to have the user
initiate a process. With the Desktop Intelligence SDK you can include a user
interaction element to add-ins and macros. Using the Desktop Intelligence
SDK you can access elements of the Desktop Intelligence user interface, and
extend the interface to accommodate the requirements of your own program.

Application

CmdBars CmdBar CmdBarControls

Clipboard CmdBarControl

CmdBarButton

CmdBarPopup

Every Desktop Intelligence Application object has a collection called


CmdBars. The CmdBars collection is the access point for all the menus, tool
bars and pop-ups in the Desktop Intelligence interface. Using this collection
you can integrate the user interface elements of your add-ins and macros into
the Desktop Intelligence interface so they appear as part of the normal
interface. Using this part of the object model you can:
• access the properties of the existing Desktop Intelligence interface
• control which menus Desktop Intelligence displays
• create user-initiated add-ins and macros

28 Desktop Intelligence Developer Guide


Customizing the User Interface
Understanding the User Interface Classes 4
• add buttons to existing tool bars
• create your own tool bars and pop-up menus

Command Bars
A command bar can be a tool bar, a menu bar, or a pop-up. Adding tool bars
and pop-up menus to the Desktop Intelligence interface is described in
“Adding a Command Bar” on page 32.

Menu Bar
Sorts
command bar
Charts
(menu bar)
Standard
Visual Basic
command bar (tool bar -
Borders
normal)
Formatting
Report command bar (pop-up)
Structure
Document Exchange
Alignment
Formula Bar

Command bars contain controls which can either be a pop-up or a button.

Desktop Intelligence Developer Guide 29


4 Customizing the User Interface
Understanding the User Interface Classes

Controls
There are two types of controls: pop-ups and buttons. Pop-ups present lists of
buttons which, when selected, perform actions.

control (pop-up)
control (button)

The CmdBarControls collection

CmdBar CmdBarControls

CmdBarControl

CmdBarButton

CmdBarPopup

The CmdBarControls collection contains all the controls for a command bar.
CmdBarControl is a generic class that represents a control.
CmdBarButton and CmdBarPopup are special cases of CmdBarControl.
They have the properties and methods of CmdBarControl plus others related
to their specialization.
The items in the CmdBarControls collection are of the type CmdBarControl.
However, if you know what type of control you are accessing, you can use the
specialized properties and methods. Most commonly you need to use this for
nesting controls.

30 Desktop Intelligence Developer Guide


Customizing the User Interface
Understanding the User Interface Classes 4
Nested controls
Pop-up controls can contain other controls.

When pop-up controls contain other controls they act as a command bar.
They have their own collection of controls that you can access using
CmdBarPopup.Controls.

CmdBarControls

CmdBarButton

CmdBarButton

CmdBarPopup CmdBarControls

CmdBarButton CmdBarButton

CmdBarPopup CmdBarControls

Desktop Intelligence Developer Guide 31


4 Customizing the User Interface
Adding a Command Bar

Adding a Command Bar


You can add tool bars and pop-up menus to the Desktop Intelligence interface
(see “Command Bars” on page 29). For information on adding controls to
existing command bars see “Adding Controls to a Command Bar” on
page 32.
To add a command bar to the collection of command bars:
• Call CmdBars.Add
• To add a tool bar, set the type to a position, for example boBarTop.
• To add a pop-up menu set the type to boBarPopup.
Example: Adding a tool bar
Sub AddCommandBar()
Dim toolbar As CmdBar
Set toolbar = Application.CmdBars.Add
("Analysis Utilities", boBarFloating) 'add command
bar
toolbar.Visible = True'make the tool bar visible
toolbar.Enabled = True'turn it on
...
toolbar.Delete'delete it when finished
End Sub
T.

Once you have added a command bar you need to add controls that users
use to access the functions you are providing. See “Adding Controls to a
Command Bar” on page 32.

Displaying Pop-up Menus


Once you have defined the controls for a pop-up menu use
CmdBar.ShowPopup to display the pop-up menu:
popup.ShowPopup

Adding Controls to a Command Bar


In general you can add any control to any of the command bars in the
CmdBars collection, however there are some restrictions:
• you cannot add pop-up controls to tool bars.
Use CmdBarControls.Add to add controls to a command bar. For information
on command bars see “Command Bars” on page 29.
Example: Adding an extra item to the Desktop Intelligence Tools menu
Sub AddTool()

32 Desktop Intelligence Developer Guide


Customizing the User Interface
Adding Controls to a Command Bar 4
Dim menuCmdPop As CmdBarControl
Dim toolCmdBut As CmdBarControl
Set menuCmdPop = Application.CmdBars(2).Controls(6)
Set toolCmdBut = menuCmdPop.Controls.Add(boControlButton)
toolCmdBut.Caption = "New Tool"
toolCmdBut.OnAction =
"Extras.rea!ToolModule.NewToolRoutine"
toolCmdBut.DescriptionText = "Useful reporting tool"
...
toolCmdBut.Delete
End Sub

Adding Faces to Buttons: the Clipboard Object


A face is the image you see on the button. Sometimes faces are also called
icons. Without a face a button appears blank and is indistinguishable from the
surface of its command bar (and similarly, without any buttons a command
bar is a thin line).
To add a face to a button you need to create the button then use the
Clipboard object to hold the file containing the face. The Clipboard object
gives you access to the system clipboard which can contain one image and
one block of text. Once the face is in the clipboard you can add (paste) it to
the button.
To put the face in the clipboard use the standard VBA function LoadPicture()
which returns an object of the type StdPicture. See the Visual Basic
documentation for details on these.

Procedure: adding a face to a button


The following procedure shows the essential steps in adding a face to a
button.
1. Clear the clipboard.
Since the clipboard is shared by other applications, it is good
programming practice to ensure that the clipboard is empty before and
after you use it.
2. Put the image in the clipboard.
3. Paste the image onto the face of the button.
4. Clear the clipboard.
The following code fragment illustrates this procedure.
Example: Adding a face to a button
Dim ToolBut As CmdBarControl'the button
Dim Bitmap As New StdPicture'the bitmap for the button

Desktop Intelligence Developer Guide 33


4 Customizing the User Interface
Creating Your Own Forms

Bitmap = LoadPicture("c:\Temp\images\Tool.bmp", , , Default)

'put the bitmap in the clipboard


Application.Clipboard.Clear'clean up the clipboard first
Application.Clipboard.SetData Bitmap, 2'2 means it's a
bitmap
ToolBut.PasteFace 'paste the bitmap onto the button
Application.Clipboard.Clear'clean up for other applications

Set Bitmap = Nothing'free the space

Useful tips for adding buttons


• Buttons attached to pop-up command bars do not need faces. Desktop
Intelligence uses the caption instead. However you can add faces to
these buttons which appear in the menus. For example, in the Desktop
Intelligence Tools menu, the Visual Basic icon appears next to the Visual
Basic Editor item of the Macros sub-menu.
• For best results make faces 16x16 pixels or 32x32 pixels.

Adding Actions to Buttons


Adding an action to a button means telling Desktop Intelligence what to do
when a user selects the button. You can add an action only to controls of type
boControlButton. In programming terms, an action is a VBA subroutine.
To add functionality to a button, use CmdBarControl.OnAction.
Example: Adding functionality to a button
Dim MultiPasteBut As CommandBarControl
...
MultiPasteBut.OnAction =
"MPaste.rea!MPasteModule.DisplayMPaste"
...
Sub DisplayMPaste()
...
End Sub
T.

Creating Your Own Forms


A form is a base to which you attach user interface controls, for example list
boxes, labels, radio buttons and command buttons.

34 Desktop Intelligence Developer Guide


Customizing the User Interface
Creating Your Own Forms 4
You can use VBA to create your own forms. Visual Basic includes a rich set of
programming tools for visually creating forms and defining the behavior of the
form and its controls using events—for example, double-click, pressing a key,
and moving the mouse.
The general procedure for creating a form is:
1. Create a form module in a Visual Basic project.
2. Add controls to the form.
3. Implement the event procedures for the control.
Example: Implementing a form event

Form events

Add pop-up

Click event

Implement
Click event

Form containing the control


for component

Desktop Intelligence Developer Guide 35


4 Customizing the User Interface
Creating Your Own Forms

36 Desktop Intelligence Developer Guide


Data Providers

chapter
5 Data Providers
Overview

Overview
This chapter describes the concepts associated with Data Providers using the
Desktop Intelligence SDK. It describes the different types of data provider and
how to access these sources of data.
More specifically, it describes:
• Working with Existing Data Providers
• Creating a Query Technique Data Provider
• Creating a VBA Procedure Data Provider.

Working with Existing Data Providers


In Desktop Intelligence the term “data provider” refers to the source of data
that end users use to create reports. You can access the data providers for a
document using the DataProviders collection.

Document DataProviders

DataProvider

Columns Column

Queries

Only data providers that query universes have a Queries object. See “Query
technique” on page 40 for more information on the Queries class.

38 Desktop Intelligence Developer Guide


Data Providers
Working with Existing Data Providers 5
Some of the properties of the DataProvider class relate directly to the
information available from the Definitions tab of the Data Manager dialog box.
For example, using the object model you can read the state of the Editable
and Refreshable check boxes.

The columns in the Results tab of the Data Manager dialog box are the same
columns you can access using the Columns class.
Example: Accessing the properties of a data provider
Sub Show_DP_Names()
Dim i As Integer
Dim message As String
For i = 1 To
Application.ActiveDocument.DataProviders.Count
message = message & Chr(10) &

Application.ActiveDocument.DataProviders.Item(i).Name
Next
MsgBox message ’display the names
End Sub
Thi.

Types of Data Provider


There are five main types of data provider:
• query technique
• freehand SQL

Desktop Intelligence Developer Guide 39


5 Data Providers
Working with Existing Data Providers

• personal text file


• VBA procedure
• stored procedure
You can access the type of a data provider using DataProvider.GetType.
The end user chooses and configures the data provider using the New Data
wizard or the New Report wizard. If editing for the data provider is enabled,
end users can also edit the data provider using the Desktop Intelligence
interface.
See “Creating a Query Technique Data Provider” on page 42 and “Creating a
VBA Procedure Data Provider” on page 43 for information on creating data
providers with the Desktop Intelligence SDK.

Query technique
A query technique is a data provider that queries a universe. When you use
the Desktop Intelligence Query Panel you create a query technique data
provider.
The parts of a query technique data provider are:
• universe
• query(ies)
The universe part defines where the information comes from. For example,
the “eFashion” universe stored in the “General” repository. This corresponds
to choosing the universe in the New Report wizard.
The query part defines which parts of the universe you are interested in. For
example the Year object of the Time period class, and the Sales revenue
object of the Measures class, where Year is equal to 2000.

Queries

Sorts Sort

Query

Conditions Condition

Results Result

40 Desktop Intelligence Developer Guide


Data Providers
Working with Existing Data Providers 5
Freehand SQL
A freehand SQL data provider is one in which the data is retrieved using an
SQL statement and database connection defined by the end user.
You can retrieve the SQL statement the end user enters using
DataProvider.SQL.
A freehand SQL file data provider has no Queries object.

Personal text file


A personal text file data provider retrieves data from plain text, Microsoft
Excel, and dBASE files. When the end user selects the personal text file
option they configure how to treat the information in the file—what is a value,
what is a column name, etc.
A personal text file data provider has no Queries object.

VBA procedure
A VBA procedure data provider is a VBA routine that retrieves data from non-
standard sources and constructs a microcube. You can access the parts of a
VBA procedure data provider through the DpVBAInterface class.
See “Creating a VBA Procedure Data Provider” on page 43 for information on
the DpVBAInterface class and how to create a VBA procedure data provider.

Stored procedure
A stored procedure data provider is an SQL script that is saved and executed
in a database.
A stored procedure data provider has no Queries object.

Loading and Unloading a Data Provider


The DataProvider class has two methods that you can use to load and unload
a DataProvider object to and from memory.
To load a DataProvider object into memory use DataProvider.Load
To unload a DataProvider object from memory use DataProvider.Unload
These methods are provided for optimizing “product-level” programs. You do
not need to use them for macros and “one-off” add-ins.

Error handling
If you do not unload a data provider from memory when you have finished
with it, it will slow down your system and may ultimately crash you program.

Desktop Intelligence Developer Guide 41


5 Data Providers
Creating a Query Technique Data Provider

It is recommended that when you load and unload a data provider to and from
memory you include a call to DataProvider. Unload in an error-handling
mechanism. If an error occurs while the data provider is loaded in memory
you could experience system errors.
Example: Unloading a data provider in an error handler
The following code fragments show how to ensure that a data provider is
removed from memory in the case of an error after it has been loaded.

Sub Modify_DataProvider()
Dim boDP As DataProvider
On Error Goto DPError’if there’s an error handle it
Set boDP =
Application.ActiveDocument.DataProviders.Item(1)
boDP.Load ’load the data provider into memory
... ’do some processing with the data provider
boDP.Unload ’unload the data provider from memory
...
Exit Sub
DPError:
boDP.Unload ’make sure that the data provider is not
in memory
MsgBox "An error occurred..."’display an error message
End Sub

Creating a Query Technique Data Provider


The Desktop Intelligence SDK has features for you to create query technique
and VBA procedure data providers.
To create a query technique:
1. Call DataProviders.AddQueryTechnique
2. Build the query.
Take great care that the query you build is runnable. That is, that the
query follows the rules for a valid query. These rules are detailed in the
Desktop Intelligence User’s Guide: Accessing Data and Data Analysis.
3. Run/Refresh the query (execute the SQL) using DataProvider.Refresh
Example: Creating a query technique data provider
Dim QT As DataProvider
Set QT = Application.ActiveDocument.
DataProviders.AddQueryTechnique("eFashion", "")
QT.Queries.Item(1).Results.Add "Time period", "Year"
QT.Refresh

42 Desktop Intelligence Developer Guide


Data Providers
Creating a VBA Procedure Data Provider 5
Building the query
DataProviders.AddQueryTechnique returns a DataProvider object that has an
empty query object. This is the programmatic equivalent to the Query Panel
stage of creating/editing a report.
From this point, just as in the user interface, you choose objects for the
results and conditions and apply sorts, then run the query. The object model
has a number of classes for this, all of which are accessed via the Queries
object.

Running and refreshing the query (filling the microcube)


To run and refresh the query use DataProvider.Refresh. This executes the
SQL instruction you built with the Query, Conditions and Results objects and
populates a microcube with the results of the SQL statement. Desktop
Intelligence then builds a report based on the microcube and any sort orders
that you have specified.

Creating a VBA Procedure Data Provider


Using Desktop Intelligence you can create a data provider that can access
data from non-standard sources and which allows you to manually control
how a microcube is populated with the data. This data provider is called a
VBA procedure data provider. Examples of non-standard data sources
accessible using a VBA procedure data provider include:
• tables on the Internet
• other Windows applications—for example, Microsoft Outlook
• Extended Markup Language (XML) documents

Defining a VBA Procedure Data Provider


To define a VBA procedure data provider:
1. In Desktop Intelligence start the New Report wizard.
2. In the Specify Data Access step select VBA procedure and click Finish
Desktop Intelligence displays the Access Data from VBA dialog box.
3. In the Use the following subroutine field, type in the name of your data
provider and click Create.
Desktop Intelligence displays a window in the VBA programming
environment containing a template for your VBA procedure.

Desktop Intelligence Developer Guide 43


5 Data Providers
Creating a VBA Procedure Data Provider

4. Enter the code for your VBA procedure, save your work, and return to
Desktop Intelligence.
The code for a VBA data provider:
• defines the parameters of the DataProvider object and the microcube
that will contain the data
• collects the data and puts it in a microcube column by column
5. Click Run.
Desktop Intelligence executes your procedure and creates two objects: a
DpVBAInterface object and a corresponding DataProvider object. The
type of the DataProvider object is “DPVBAC” to indicate that it is a VBA
procedure data provider.
Example: Filling a microcube
The following example shows how to fill a column in a microcube with data. In
this case the data is simply a number. If you want to add information from
another source, you need to add code to fetch the data.
Sub SimpleDpVBA(dpInterface As DpVBAInterface)
Dim i As Integer'loop index
Dim Col As DpVBAColumn'a column in the microcube
Dim Cols As DpVBAColumns'the columns of the microcube
Dim newCube As DpVBACube'the microcube we’re filling

Set newCube = dpInterface.DpVBACubes.Item(1)'there is only


one cube
Set Cols = newCube.DpVBAColumns'reference the columns of the
cube
Cols.SetNbColumns(4)'how many columns in the cube?

Set Col = Cols.Item(1)'look at the first column in the cube


Col.Name = "Number"'the name that appears in the report
Col.Type = boCharacterObject'what sort of information is it?
Col.Qualification = boDimension'dimension, detail or
measure?
For i = 1 To 10'for each row (item)
Col.Item(i) = i'set the value to a number
Next i
... 'fill the other columns in the cube
End Sub

Defining a VBA procedure data provider with the SDK


You can define a VBA procedure data provider without using the wizards. The
procedure you define must have an argument whose type is DpVBAInterface.
Example: VBA procedure data provider declaration
Sub EasyDPVBA(dp As DpVBAInterface)
... 'define a VBA procedure data provider

44 Desktop Intelligence Developer Guide


Data Providers
Creating a VBA Procedure Data Provider 5
End Sub
.

The data providers you define in this way appear in the list of VBA data
providers when you use the New Report and New Data wizards.

The DpVBAInterface Class


You access VBA procedure data providers using the DpVBAInterface class
and its descendants to access the microcube and its columns.

DpVBAInterface

DpVBACubes DpVBACube

DpVBAColumns DpVBAColumn

DpVBACubes is a collection that always contains one element.

Using a VBA Procedure Data Provider


Once you have defined a VBA procedure data provider you can use it to
create reports by choosing it from the list of VBA procedure data providers
when you choose New Data Provider or Create New Report. You can also
execute your code by refreshing a report that already uses it to access data.

Run

execute Refresh event


DataProvider
object
Report
data
VBA
procedure

fill
data source display

Desktop Intelligence Developer Guide 45


5 Data Providers
Creating a VBA Procedure Data Provider

The difference between running and refreshing


Run sets the parameters of the data provider and refreshes the information in
the microcube. Refresh doesn’t change the parameters of the data provider.
A data provider refresh happens when:
• you call DataProvider.Refresh
• either the after refresh or before refresh document events occur,
triggered by the user, or a call to Document.Refresh
• the user chooses refresh
• the user creates and runs a data provider using:
• the query panel
• the new data wizard
• the edit data provider panel
• you run a VBA procedure data provider with DataProviders.AddDPVBA
This means that if you change the parameters of a VBA procedure data
provider by directly changing the VBA code (rather than choosing Edit Data
Provider… from the Data menu, selecting the data provider, and clicking Edit)
the changes you make might not appear until the user runs the data provider.

Bypassing the wizards with AddDPVBA


You can instruct Desktop Intelligence to execute a VBA procedure data
provider. In another sub-routine call DataProviders.AddDPVBA. This is
equivalent to choosing New Data Provider from the Desktop Intelligence
menu. When you call this method, Desktop Intelligence executes the
procedure you specify but does not create a report for the microcube.
Example: Adding a VBA procedure data provider with
DataProviders.AddDPVBA
Define a method that creates a new VBA procedure data provider.
Sub adding_a_DPVBA()
Dim dpvba As New DataProvider
Set dpvba = Application.ActiveDocument.DataProviders.
AddDPVBA("SpecialData.rea!SDModule.dpvbaSpecialData")
... ’processing with the new data provider

In the SDModule of SpecialData.rea you define a VBA procedure that


Desktop Intelligence executes to define the data provider.

Sub dpvbaSpecialData(dpspecial As DpVBAInterface)


... ’populate a microcube with data

46 Desktop Intelligence Developer Guide


Data Providers
Creating a VBA Procedure Data Provider 5
Sharing a VBA Data Provider as an Add-in
To share the VBA procedure data providers you create, save the document in
which you defined the VBA procedure data provider as an add-in. When other
users include the add-in document in their list of add-ins your VBA procedure
data provider appears in their list of VBA procedures when they create a new
report or a new data provider.
Note: This functionality is not supported for documents published in
BusinessObjects Enterprise.

Desktop Intelligence Developer Guide 47


5 Data Providers
Creating a VBA Procedure Data Provider

48 Desktop Intelligence Developer Guide


Business Objects
Information Resources

appendix
A 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.

Documentation
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 http://www.businessobjects.com/support/.
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 web site at: http://www.businessobjects.com/support/.

Documentation on the product CD


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

50 Desktop Intelligence Developer Guide


Customer support, consulting and training A
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: documentation@businessobjects.com.
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: http://www.businessobjects.com/
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 web site 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.
http://www.businessobjects.com/support/

Desktop Intelligence Developer Guide 51


A Customer support, 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. Expertise is available in
relational and multidimensional databases, in connectivities, database design
tools, customized embedding technology, and more.
For more information, contact your local sales office, or contact us at:
http://www.businessobjects.com/services/consulting/

Looking for training options?


From traditional classroom learning to targeted e-learning seminars, we can
offer a training package to suit your learning needs and preferred learning
style. Find more information on the Business Objects Education web site:
http://www.businessobjects.com/services/training

52 Desktop Intelligence Developer Guide


Useful addresses at a glance A
Useful addresses at a glance

Address Content
Business Objects product Information about the full range of
information Business Objects products.
http://www.businessobjects.com
Product documentation Business Objects product
http://www.businessobjects.com/ documentation, including the
support Business Objects Documentation
Roadmap.
Business Objects Documentation Send us feedback or questions
mailbox about documentation.
documentation@businessobjects.com
Online Customer Support Information on Customer Support
http://www.businessobjects.com/ programs, as well as links to
support/ technical articles, downloads, and
online forums.
Business Objects Consulting Information on how Business
Services Objects can help maximize your
http://www.businessobjects.com/ business intelligence investment.
services/consulting/
Business Objects Education Information on Business Objects
Services training options and modules.
http://www.businessobjects.com/
services/training

Desktop Intelligence Developer Guide 53


A Useful addresses at a glance

54 Desktop Intelligence Developer Guide


Index
A C
accessing Chr function 14
application events 25 classes
Desktop Intelligence user interface 28 command bars 30
VBA procedure data provider 45 DpVBAInterface 45
actions queries 40, 42
adding to buttons 34 user interface 28
adding Clipboard object
actions to buttons 34 pasting faces 33
buttons 32 collections
command bars 32 command bars 30
controls 32 command bar controls
macros 20 actions 34
add-ins 10 adding 32
creating 21 collection 30
distributing 21 definition 30
VBA procedure data provider 47 nested 31
application events 23 command bars
implementing 25 adding 32
Application object 25, 28 adding controls 32
arrays collection 30
indexes 12 definition 29
VBA 12 consultants, Business Objects 52
controls
B see command bar controls
creating
bitmaps
add-ins 21
adding to buttons 33
macros 18
building
query technique data provider 42
query technique data provider 43
VBA procedure data provider 43
Business Objects
customer support 51
consulting services 52, 53
customizing
support services 51
Desktop Intelligence interface 27
training services 52, 53, 53
buttons
adding 32 D
adding actions 34 data
adding faces 33 on the Internet 43
definition 30 other applications 43

Desktop Intelligence Developer Guide 55


Index

XML 43 application 23
data providers 37–47 document 23, 24
editing 46 form 34
freehand SQL 41 implementing 11, 24
handling errors 41 order 23
loading and unloading 41 triggers 23
optimizing 41 Excel
personal text file 41 querying 41
query technique 40 executing macros 19
stored procedure 41 Extended Markup Language
types 39 see XML
VBA procedure see VBA procedure data external object libraries 14
provider
dBASE F
querying 41
faces
declaring
adding 33
arrays in VBA 12
recommended size 34
variables in VBA 11
feedback, on documentation 51
Desktop Intelligence
filling a microcube 43
customizing the interface 27
flow control
development environment
in VBA 12
VBA 10, 14
forms
disabling
creating 34
macros 18
freehand SQL data provider
displaying pop-up menus 32
definition 41
distributing
functions 11, 14
add-ins 21
VBA procedure data provider 47
document events 23, 24 H
documentation handling
feedback on 51 errors in VBA 13
on product CD 50
on the web 50 I
roadmap 50
implementing
DpVBAInterface object 43, 45
form events 34
implementing events 11, 24
E including
editing external object libraries in VBA 14
data provider 46 indexing
education. See training arrays in VBA 12
errors information resources 50
data providers 41 Internet
handling 41 querying 43
handling in VBA 13
events

56 Desktop Intelligence Developer Guide


Index

L procedures 11
loading browsing in VBA 14
data providers 41
Q
M Queries object 43
macros 10 Query Panel 43
adding 20 query technique data provider
creating 18 creating 39, 42
running 19 definition 40
tool tips 20 running and refreshing 43
memory management
data providers 41 R
menu bar .rea 21
definition 29 referencing
menus external object libraries in VBA 14
nesting 31 refreshing
microcube 46 data providers 46
filling 43, 43, 44 query technique data provider 43
reports 43, 46
N creating 45
nesting controls 31 repository 40
resources 50
running
O data providers 46
Object Browser 10 macros 19
opening 14 query technique data provider 43
object models
user interface 28
objects S
browsing in VBA 14 sharing
external 14 VBA procedure data providers 47
On Error statement 13 showing pop-up menus 32
Online Customer Support 51 SQL 43
optimizing data provider 41
data providers 41 stored procedure data provider
definition 41
sub-routines 11, 18
P support
personal text file data provider customer 51
definition 41 locations 51
pop-up menus technical 51
adding 32 web site 51
definition 29, 30
displaying 32
nesting 31

Desktop Intelligence Developer Guide 57


Index

T running and refreshing 46


technical support 51 using 45
tool bars Visual Basic
adding 32 editor 10, 20
definition 29 tool bar 19
tool tips
macros 20 W
training, on Business Objects products 52 web
customer support 51
U getting documentation via 50
universes useful addresses 53
querying 40, 43 web sites
unloading support 51
data providers 41 training 52
user input 28 With statement 13
user interface
customizing 27 X
using XML 43
VBA procedure data provider 45

V
VBA 9–??
arrays 12
creating forms 34
data provider see VBA procedure data provider
data types 11
events 11
flow control 12
functions 14
implementing an event 24
language summary 11
On Error statement 13
variables 11
With statement 13
writing macros 18
VBA procedure data provider
creating 39, 43
defining 43
defining with SDK 44
definition 41
development environment 10
distributing 47
DpVBAInterface class 45
executing with SDK 46

58 Desktop Intelligence Developer Guide

You might also like