InsertView

Description

Insert an Oracle Analytics Cloud 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 Analytics Cloud provider URL.

sourcePath: The location of the view in the Oracle Analytics Cloud Catalog.

To express the path of the view, in a web browser, access the Oracle Analytics Cloud 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 Analytics Cloud 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 17-1, you must create an array of four BIReportPrompts:

  • The first element contains the selection for "D1 Office"

  • The second element is for "1 - Revenue"

  • The third element is for "P3 LOB"

  • The fourth element is for "T00 Calendar Date"

The sample code follows Figure 17-1.

Figure 17-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 17-1.

Table 17-1 Render Formats and View Types

Render Format Value View Types to be Used
Default_Format All Views
ExcelPivot Pivot Table View Only
ExcelTable Table View Only
Image Chart 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:

  • NewSheet—Inserts each view in the compound view in a new sheet.

  • SameSheet—Inserts each view in the compound view in the same sheet.

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/sv_vba_dev", "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_vba_dev/promptAllTypes", "tableView!1", prompts, Default_Format, SameSheet

End Sub