Using Parameter in table view

Rev
New Contributor

Hi all,

We're trying to pass below listed parameters to the table view:

Case Is = SpreadsheetFunctionType.GetCustomSubstVarsInUse
	Dim paramList As New List (Of String)
	paramList.Add("ParamScenario")
	paramList.Add("prm_UD4_Select")
	Return paramList

Case Is = SpreadsheetFunctionType.GetTableView
	Dim objDictionary As Dictionary(Of String,String) = args.CustSubstVarsAlreadyResolved
	Dim objDataSet As DataSet = BRApi.Dashboards.Process.GetAdoDataSetForAdapter(si, _
		False, "da_Capital_Reports", "Getfullreport", objDictionary) 
	Dim dts As New DataTable()                     
	dts = objDataSet.Tables(0)                                                                        
	Dim tableview As New TableView()
	tableview.PopulateFromDataTable(dts,True,True)
	tableview.CanModifyData=True
	Return tableview

Case Is = SpreadsheetFunctionType.SaveTableView

 

but the refresh sheet (via excel add-in) errors out as "Conversion from string "tu" to type 'Integer' is not valid.
Input string was not in a correct format."  when ParamScenario chosen is "2023_233_M9_W"(monthly forecast) whereas refresh works fine when ParamScenario chosen is "2023_233_W"(quarterly forecast).

Kindly advise if the scenario naming has any issue? Also, please guide on if we can check on any hardcoding of scenario naming format.

Note: Monthly forecast scenario naming is new to the system.

Thanks in advance!

1 REPLY 1

JackLacava
Community Manager
Community Manager

I would suggest to first dump out the results to an untyped TableView, and from there figure out why the automated conversion is tripping up.

' set the last option to False to treat everything as String
tableview.PopulateFromDataTable(dts,True,False)