Siebel Reports Administration Guide > Method Reference > Essential DataStream Methods >

Start Method


The Start method has two prominent roles. It creates the Siebel Object Manager interface objects required to populate the data row, and it makes sure that the required fields are active. The Start method is called only on the master datastream. If a subreport uses the same business object, the subreport (child) datastream uses the interface created by the parent (master) datastream. Similarly, since fields are activated in the Start method, the master datastream activates fields for all its children.

NOTE:  The code is written such that the user's screen does not change while the report is being generated, even if a subreport uses a different business component.

The following code sample is from the Start method in the ssAccountQuery datastream component in the Aclist (Account List) report.

Function Start () As Boolean

Dim bCurRowOnly As Boolean

Dim bReExecute As Boolean

Dim bUpdateLinks As Boolean

Dim bStatus As Boolean

Dim mainRowId As String

Dim busObjName As String

Dim SortSpecDyn As String

Dim searchSpec As String

Dim curViewMode As Integer

bCurRowOnly = False

baseReport::bCurRowOnly = bCurRowOnly

bReExecute = False

baseReport::bQueryExecuted = False

bUpdateLinks = False

errCode = 0

mainRowId = ""

busObjName = ""

bStatus = Super::Start ()

If (bStatus = False) Then

Start = False

Exit Function

End If

ssAppServer = ssReport::ssiSiebelServer

ssModelSetPositionId (ssAppServer, ssReport::ssPositionId)

ssBO = ssModelGetBusObject (ssAppServer, ssReport::ssBusObjectName)

ssReport::ssActiveBusObject = ssBO

' SearchSpec is recieved depending on where it is originated

SearchSpec = ""

   If (ssReport::ssSearchSpec <> "") And (errCode = 0) Then searchSpec = ssReport::ssSearchSpec

' SortSpec is recieved depending on where it is originated

SortSpecDyn = "Name"

   If (ssReport::ssSortSpec <> "") And (errCode = 0) Then SortSpecDyn = ssReport::ssSortSpec

If (errCode = 0) Then ssAccount = ssBusObjGetBusComp (ssBO, "Account")

If (errCode = 0) Then ssBusCompSuppressNotification (ssAccount)

If (errCode = 0) And (ssType = 2) Then ssBusCompDeactivateFields (ssAccount)

If (errCode = 0) Then curViewMode = ssBusCompGetViewMode (ssAccount)

' If the main report BusComp has a search or sort spec,

' or uses a field that isn't already active, its query

' must be re-executed.

If (ssType = 2) Then bReExecute = True

If (Not bReExecute) Then bReExecute = (searchSpec <> "") Or (SortSpecDyn <> "")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsExecuted", "") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Account Status") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "City") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Competitor") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Country") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Description") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Industry") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Location") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Main Fax Number") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Main Phone Number") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Name") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Parent Account Name") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Postal Code") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "State") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Street Address") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Synonym") = "N")

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "IsFieldActive", "Type") = "N")

' Last check if business component needs to be re-executed

If (errCode = 0) And (Not bReExecute) Then bReExecute = (ssBusCompInvokeMethod (ssAccount, "ReExecuteReport", "") = "Y")

' Cache the current row-id so it can be re-queried

If (bCurRowOnly) Then mainRowId = ssReport::ssActiveRowId

If (errCode = 0) And (ssType = 1) And (bReExecute) Then

' To re-execute a current-row-only report, the active

' BusComp need not be disturbed. Another BusObj can

' be constructed just for this query.

' This is NOT applicable for server based report generation.

If (bCurRowOnly) And (ssReport::ssBusObjectName = "") Then

baseReport::bQueryExecuted = True

If Not ( ssAccount = 0 ) Then ssBusCompAllowNotification (ssAccount)

If (errCode = 0) Then busObjName = ssBusObjGetName (ssBO)

If (errCode = 0) Then ssBO = ssModelGetBusObject (ssAppServer, busObjName)

If (errCode = 0) Then ssAccount = ssBusObjGetBusComp (ssBO, "Account")

If (errCode = 0) Then ssBusCompSetViewMode (ssAccount, curViewMode)

If (errCode = 0) Then ssBusCompSuppressNotification (ssAccount)

End If

End If

' Now actually setup the main report BusComp

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Account Status")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "City")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Competitor")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Country")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Description")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Industry")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Location")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Main Fax Number")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Main Phone Number")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Name")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Parent Account Name")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Postal Code")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "State")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Street Address")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Synonym")

If (errCode = 0) Then ssBusCompActivateField (ssAccount, "Type")

If (errCode = 0) Then ssBusCompInvokeMethod (ssAccount, "SetIgnoreMaxCursorSize", "Y")

If (errCode = 0) And (ssType = 2) And (bCurRowOnly = FALSE) Then

If (baseReport::bSetForward) Then

ssBusCompInvokeMethod(ssAccount, "GotoBookmarkT", ssReport::ssBookmark)

Else

ssBusCompInvokeMethod(ssAccount, "GotoBookmarkF", ssReport::ssBookmark)

End If

End If

If (errCode = 0) And (searchSpec <> "") And ((Not bCurRowOnly) Or (ssReport::ssBusObjectName <> "")) Then

ssBusCompSetSearchExpr (ssAccount, searchSpec)

End If

If (errCode = 0) And (SortSpecDyn <> "") Then

ssBusCompSetSortSpec (ssAccount, SortSpecDyn)

End If

If (errCode = 0) And (ssReport::ssBusObjectName <> "") And (ssReport::ssViewMode <> "") Then ssBusCompSetViewMode (ssAccount, CInt (ssReport::ssViewMode))

' Re-execute business components as necessary

If (errCode = 0) Then

If (bReExecute) Then

If (bCurRowOnly) And (mainRowId <> "") Then ssBusCompSetSearchExpr (ssAccount, "Id = """ + mainRowId + """")

If (errCode = 0) Then ssBusCompExecuteQuery2 (ssAccount, baseReport::bSetForward, True)

Elseif (bUpdateLinks) Then

ssBusCompInvokeMethod (ssAccount, "UpdateLinks", "")

End If

End If

' Process errors and return

If (errCode = 0) Then

bStatus = True

Else

bStatus = False

ssProcessLastError(ssAppServer, "", "")

End If

Start = bStatus

End Function

At this point, the Siebel business component, in this case Account, has been exposed to Actuate, and the Siebel Object Manager interface has been called. The fields for the business object identified by the Siebel client's active view have been activated and are available to the data row object.


 Siebel Reports Administration Guide 
 Published: 18 July 2003