Get selected value from Combo Box and use it in a Table View

SeanV
New Contributor III

I have a dashboard that has 2 components,.

1. A Combo Box that is populated with a sql query in a Bound List Parameter.

2. A Spreadsheet that is populated with a Table View.   The table view is generated using a Spreadsheet Business Rule.

How do I pass the selection from the combo box to the table view?

 

Thank you for any suggestions.

1 ACCEPTED SOLUTION

SeanV
New Contributor III

Thank you for the response.   

I wasn't ablet to get BRApi.Dashboards.Parameters.GetLiteralParameterValue to pickup the parameter from the Combo Box.

 

However I used  args.CustSubstVarsAlreadyResolved("parameterNameHere") and assigned that to a string variable.  That did work.  It got the parameter value from the combo box.

View solution in original post

7 REPLIES 7

JackLacava
Moderator
Moderator

You should be able to grab the value in your Tableview rule with BRApi.Dashboards.Parameters.GetLiteralParameterValue. You should place the two components in separate Dashboard frames though, so you can refresh the one with the spreadsheet when the combobox value changes - otherwise it won't pick it up.

SeanV
New Contributor III

Thank you for the response.   

I wasn't ablet to get BRApi.Dashboards.Parameters.GetLiteralParameterValue to pickup the parameter from the Combo Box.

 

However I used  args.CustSubstVarsAlreadyResolved("parameterNameHere") and assigned that to a string variable.  That did work.  It got the parameter value from the combo box.

Krishna
Valued Contributor

Could you please provide the sample BR ? for the parameter from ComboBox ?

Thanks
Krishna

SeanV
New Contributor III

p_Select_Year is the Parameter.

There was a larger issue at play here, I first set this up on a 6.8x version and it wasn't working (The table view in a dashboard wasn't picking up the selection from the combo box) then I tried it on a 7x version and it worked.

 

Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As SpreadsheetArgs) As Object
Try
Select Case args.FunctionType

' Case Is = SpreadsheetFunctionType.Unknown

Case Is = SpreadsheetFunctionType.GetCustomSubstVarsInUse
If args.TableViewName.XFEqualsIgnoreCase("UserLogonActivity")
Dim paramList As New List(Of String)
paramList.Add("p_Select_Year")
Return paramList
End If

Case Is = SpreadsheetFunctionType.GetTableView
If args.TableViewName.XFEqualsIgnoreCase("UserLogonActivity")
Dim currentYear As String = args.CustSubstVarsAlreadyResolved("p_Select_Year")
Return GetUserLogonActivity(Si,currentYear)
End If

' Case Is = SpreadsheetFunctionType.SaveTableView

End Select

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

Krishna
Valued Contributor

Thanks for the Quick response. Appreciated. p_Select_Year is a parameter correct ?

Thanks
Krishna

SeanV
New Contributor III

Yes

Krishna
Valued Contributor

Thanks

Thanks
Krishna