I’m trying to set UD02.Key1 in a BAQ report from a ContextValue. I have followed all the instructions I’ve found online to help out with this but I get an error trying to set the value. I have ensured that the correct ContextValue was passed. It’s failing at line “paramView.dataView(paramView.Row)(“Key1”) = BAQReportForm.LaunchFormOptions.ContextValue.ToString” with an Inner Exception saying that it can’t set Key1.
Private Sub BAQReportForm_Load(ByVal sender As Object, ByVal args As EventArgs)
' Add Event Handler Code
If (Not (BAQReportForm.LaunchFormOptions) Is Nothing) Then
If (Not (BAQReportForm.LaunchFormOptions.ContextValue) Is Nothing) Then
Dim paramView As EpiDataView = CType(oTrans.EpiDataViews("ReportParam"), EpiDataView)
paramView.dataView(paramView.Row).BeginEdit
paramView.dataView(paramView.Row)("Key1") = BAQReportForm.LaunchFormOptions.ContextValue.ToString
paramView.dataView(paramView.Row).EndEdit
oTrans.NotifyAll
End If
End If
End Sub
This is the code setting the value in my UD menu.
Private Sub printTags_ToolClick(ByVal sender As Object, ByVal args As ToolClickEventArgs)
Dim lfo As LaunchFormOptions = New LaunchFormOptions
Dim edvUD02 As EpiDataView = CType(oTrans.EpiDataViews("UD02"), EpiDataView)
Dim ncmrNum As String = String.Empty
ncmrNum = Me.txtNCMRNum.Text
lfo.ContextValue = ncmrNum
ProcessCaller.LaunchForm(oTrans, "NCMRTag", lfo)
End Sub