InsertView

Description

Insert an Oracle BI EE view into an Office application.

Syntax

Function InsertView(

connectionContext As String,

sourcePath As String,

viewName As String,

prompt() As BIReportPrompt,

format As SVREPORT_RENDER_FORMAT,

insertOption As SVREPORT_COMPOUND_VIEW_INSERT_OPTION) As Boolean

Parameters

connectionContext: The Oracle BI EE provider URL.

sourcePath: The location of the view in the Oracle BI EE Catalog.

To express the path of the view, in a web browser, access the Oracle BI EE Catalog, navigate to the view folder, and note the URL of the folder. The path of the folder can then be derived after decoding the folder URL (which is encoded with URL encoding). To specify a location of the view, include the analysis name in the path. For example, in the browser, the URL of a folder in Oracle BI EE is: .

http://xxxx.com:xxxx/analytics/saw.dll?catalog#%7B%22location%22%3A%22%2Fusers%2Fadministrator%2Fsvc_auto_bugs%22%7D

Decoding the URL and the URL is changed to:

http://xxxx.com:xxxx/analytics/saw.dll?catalog#{"location":"/users/administrator/svc_auto_bugs"}

After getting the folder path, append the analysis name to the path. In the end, the path looks like:

/users/administrator/svc_auto_bugs/AnalysisName

viewName: The name of the view.

prompt: The prompts for inserting the view.

Prompts are an array of BIReportPrompt. BIReportPrompt is a class with only one member which is an array of strings. All prompt input should be converted to strings. The order of the BIReportPrompt array should be same as the order of the prompts in the Prompt Selector dialog box.

For example, to specify prompt values for the prompts in the Figure 1, Prompt Selector Dialog Box with Selections for Office, Line of business, and Calendar Date, you must create an array of four BIReportPrompts:

The sample code follows Figure 1, Prompt Selector Dialog Box with Selections for Office, Line of business, and Calendar Date.

Figure 1. Prompt Selector Dialog Box with Selections for Office, Line of business, and Calendar Date

Prompt Selector Dialog Box with Selections for Office, Line of business, and Calendar Date
Dim prompts(0 To 3) As BIReportPrompt

Dim firstPrompt(0 To 3) As String
firstPrompt(0) = "Madison Office"
firstPrompt(1) = "Merrimon Office"
firstPrompt(2) = "Spring Office"
firstPrompt(3) = "Tellaro Office"
prompts(0).Values = firstPrompt

Dim secondPrompt(0 To 0) As String
secondPrompt(0) = "500"
prompts(1).Values = secondPrompt

Dim ThirdPrompt(0 To 5) As String
ThirdPrompt(0) = "Communication"
ThirdPrompt(1) = "Digital"
ThirdPrompt(2) = "Electronics"
ThirdPrompt(3) = "Games"
ThirdPrompt(4) = "Services"
ThirdPrompt(5) = "TV"
prompts(2).Values = ThirdPrompt

Dim FourthPrompt(0 To 0) As String
ForthPrompt(0) = "5/15/2009"
prompts(3).Values = ForthPrompt

format: The format to be rendered. Valid render format values are described in Table 7.

Table 7. Render Formats and View Types

Render Format ValueView Types to be Used
Default_FormatAll Views
ExcelPivotPivot Table View Only
ExcelTableTable View Only
ImageChart View Only

insertOption: For compound views only. This option specifies how to insert all the views in a compound view and is ignored for individual views.

Valid values:

Return Value

Indicates if the operation succeeds or not.

Example

Sub InsertTableTest()

Dim obiee As IBIReport
Set obiee = New SmartViewOBIEEAutomation

Dim prompts() As BIReportPrompt

obiee.InsertView “http://xxx.com:xxxx/analytics/jbips”, "/shared/SmartView/OBIEE/reshma", "tableView!1", prompts, Default_Format, NewSheet

End Sub

Sub InsertPromptTableTest()

Dim obiee As IBIReport
Set obiee = New SmartViewOBIEEAutomation

Dim prompts(0 To 3) As BIReportPrompt

Dim firstPrompt(0 To 3) As String
firstPrompt(0) = "Madison Office"
firstPrompt(1) = "Merrimon Office"
firstPrompt(2) = "Spring Office"
firstPrompt(3) = "Tellaro Office"
prompts(0).Values = firstPrompt

Dim secondPrompt(0 To 0) As String
secondPrompt(0) = "500"
prompts(1).Values = secondPrompt

Dim ThirdPrompt(0 To 5) As String
ThirdPrompt(0) = "Communication"
ThirdPrompt(1) = "Digital"
ThirdPrompt(2) = "Electronics"
ThirdPrompt(3) = "Games"
ThirdPrompt(4) = "Services"
ThirdPrompt(5) = "TV"
prompts(2).Values = ThirdPrompt

Dim FourthPrompt(0 To 0) As String
ForthPrompt(0) = "5/15/2009"
prompts(3).Values = ForthPrompt

obiee.InsertView “http://xxx.com:xxxx/analytics/jbips”,"/shared/SmartView/SV_Michelle/promptAllTypes", "tableView!1", prompts, Default_Format, SameSheet

End Sub