Data source Connector - Nested Drill back

mkalluri
New Contributor II

Hi,

 

      I am trying to build a Drill back functionality in one of data source connector business rules. I tried looking into One Stream reference guide on Data Source connector business rules and I found below reference for nested Drill back functionality.

mkalluri_0-1686765932473.png

But practically when I tried to drill back on a drill back detail row, OS returns following message. The click on the drill back is not even calling the connector business rules any more.

mkalluri_1-1686766219438.png

Can someone help me with the ways to code with nested drill backs. I tried to follow the examples from Golfstream application.

Private Function GetDrillBackTypeList(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Transformer, ByVal args As ConnectorArgs) As List(Of DrillBackTypeInfo)
	Try
		'Create the SQL Statement
		Dim drillTypes As New List(Of DrillBackTypeInfo)

		If args.DrillCode.Equals(StageConstants.TransformationGeneral.DrillCodeDefaultValue, StringComparison.InvariantCultureIgnoreCase) Then
			'Source GL Drill Down
			drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.FileShareFile, New NameAndDesc("InvoiceDocument", "Invoice Document")))
			drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialTypeDetail", "Material Type Detail")))

		ElseIf args.DrillCode.Equals("BOMDetail", StringComparison.InvariantCultureIgnoreCase) Then
			'Material Type Drill Down
			drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialAllProducts", "Material All Products")))
			drillTypes.Add(New DrillBackTypeInfo(ConnectorDrillBackDisplayTypes.DataGrid, New NameAndDesc("MaterialAllVendors", "Material All Vendors")))

		End If

		Return drillTypes

	Catch ex As Exception
		Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
	End Try
End Function

'Execute specific drill back type
Private Function GetDrillBack(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Transformer, ByVal args As ConnectorArgs, ByVal connectionString As String) As DrillBackResultInfo
	Try
		If args.DrillBackType.NameAndDescription.Name.Equals("InvoiceDocument", StringComparison.InvariantCultureIgnoreCase) Then
			'Level 1: Show FileShare File
			Dim drillBackInfo As New DrillBackResultInfo
			drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.FileShareFile
			drillBackInfo.DocumentPath = Me.GetDrillBackDocPath_L1(si, globals, api, args)
			Return drillBackInfo

		ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialTypeDetail", StringComparison.InvariantCultureIgnoreCase) Then
			'Level 1: Return Drill Back Detail
			Dim drillBackSQL As String = GetDrillBackSQL_L1(si, globals, api, args)
			Dim drillBackInfo As New DrillBackResultInfo
			drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid
			drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber)
			Return drillBackInfo

		ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialAllProducts", StringComparison.InvariantCultureIgnoreCase) Then
			'Level 1: Return Drill Back Detail
			Dim drillBackSQL As String = GetDrillBackSQL_L2(si, globals, api, args, True, False)
			Dim drillBackInfo As New DrillBackResultInfo
			drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid
			drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber)
			Return drillBackInfo

		ElseIf args.DrillBackType.NameAndDescription.Name.Equals("MaterialAllVendors", StringComparison.InvariantCultureIgnoreCase) Then
			'Level 1: Return Drill Back Detail
			Dim drillBackSQL As String = GetDrillBackSQL_L2(si, globals, api, args, False, True)
			Dim drillBackInfo As New DrillBackResultInfo
			drillBackInfo.DisplayType = ConnectorDrillBackDisplayTypes.DataGrid
			drillBackInfo.DataTable = api.Parser.GetXFDataTableForSQLQuery(si, DbProviderType.OLEDB, connectionString, True, drillBackSQL, False, args.PageSize, args.PageNumber)
			Return drillBackInfo

		Else
			Return Nothing
		End If

	Catch ex As Exception
		Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
	End Try
End Function

Thanks,

Mohan Alluri.

1 ACCEPTED SOLUTION

mkalluri
New Contributor II

I was able to find the solution and it is to have a column with name called "DrillTypeCode" in the first drill back result. When you drill back again the connector will be called with ActionType as GetDrillBackTypes and args.DrillCode will have the value from the column "DrillTypeCode" of the row you are performing drillback.

View solution in original post

10 REPLIES 10

I've written about this in the Planning book with examples. You need to play around with your first drill and use that in the second.

Hi ckattookaran,

Can you point me to the examples you are referring to please?

Thanks.

mkalluri
New Contributor II

I was able to find the solution and it is to have a column with name called "DrillTypeCode" in the first drill back result. When you drill back again the connector will be called with ActionType as GetDrillBackTypes and args.DrillCode will have the value from the column "DrillTypeCode" of the row you are performing drillback.

seangly
New Contributor III

Were you able to pull data from Drill Back Detail screen same as the one from Staging Area (sourceValues.Item(StageTableFields.StageSourceData.DimEntity)?

mkalluri
New Contributor II

Yes, precisely you can use below statement.

args.GetSourceRowValue(StageTableFields.StageSourceData.DimEntity)  

seangly
New Contributor III

I mean from the Drill Back Detail as I need one field that is not in the Staging Area.

seangly_0-1695240611194.png

 

mkalluri
New Contributor II

If you are working on nested drill back functionality you can always get the value of the field in a row with args.GetSourceRowValue("[column name]")

seangly
New Contributor III

That worked!  Thank for your help.

marisolbritton
New Contributor III

Hi!  I'm trying to create something similar.  Do you mind sharing step by step instructions please?

Hi,
Are you trying to do a nested drill back ?