Professional Documents
Culture Documents
Time to Complete
Approximately 40 minutes.
Overview
This tutorial introduces the VBA toolkit for Smart View. Smart View enables you to customize and automate common tasks by using VBA functions. The menu equivalents are Visual Basic functions that execute the Hyperion menu commands. In this tutorial, you use the VBA toolkit to create buttons on a Smart View worksheet. The buttons connect to, and disconnect from, a data source.
Scenario
Your users asked you, a Smart View administrator, to create an easy way for them to connect to, and disconnect from, their most common applications.
Prerequisites
Before starting this tutorial, you should: 1. Have an existing connection to a data source in Smart View (Reports is used in the tutorial.) 2. Know the user name and password of the user who connects to the data source
This file contains all Smart View VBA functions. By importing it, you are declaring all functions ready for use. You can also declare only those functions that you will use by deleting unused functions in the .BAS file.
3. In the Add Procedure dialog box, perform these actions: a. b. c. In the Name box, enter ConnectReports. (You can substitute the name of your application for "Reports.") Under Type, select Sub. Click OK.
Sheetname is the name of the worksheet to operate on. Username is the name of a valid user for the data source provider. Password is the password for this user. Connection is the connection name of the data source.
6. In the Add Procedure dialog box, perform these actions: a. b. c. In the Name box, enter DisconnectReports. (You can substitute the name of your application for "Reports.") Under Type, select Sub. Click OK.
7. Within the sub procedure, enter x=HypDisConnect("SheetName",True). Sheetname is the name of the worksheet to operate on.
2. If any connections are active, select the active connection, and click Disconnect to close it. Click X to close the Smart View panel.
4. On the Developer tab, click Insert, and select the Button icon.
8. Repeat steps 4, 5, and 6 to create another button and assign the DisconnectReports function to it.
11. On the Smart View tab, click Open > Active Connections to verify that you are connected to the data source.
13. On the Smart View tab, select Open > Active Connections to verify that you are disconnected from the data source.
Summary
In this tutorial, you learned how to:
Import the Smartview.bas file to declare VBA functions Create a VBA module and add VBA procedures Assign VBA functions to buttons