Hi,
I am developing a LocalReport using the ReportViewer component
and the report contains a subreport. The information is stored in a
typical master-detail table arrangement with a foreign key so the data
lends itself to this - fairly straightforward .
My problem is that the subreport requires the key value to be
passed to it - the key value is named iPersonID an integer. I know
how to set up the subreport in the report designer to look for an
incoming parameter, but I don't know how to pass that parameter in the
VB code. My event handler is shown below:
Dim Arg1 As SubreportProces singEventArgs
Public Sub DemoSubreportPr ocessingEventHa ndler(ByVal sender As Object,
_
ByVal e As SubreportProces singEventArgs)
Dim prmPersonID As ReportParameter InfoCollection
prmPersonID = Arg1.Parameters
Me.rvwrDraft.Lo calReport.SetPa rameters(prmPer sonID)
If InvestigationsD ataSet.dtAddHis tory Is Nothing Then
GetAddressHisto ryData()
End If
e.DataSources.A dd(New ReportDataSourc e("dtAddHistory "))
End Sub
It builds fine, but at run time, the reportview displays the message
"The iPersonID parameter is missing a value."
How do I set the value of the subreport input parameter in my VB code?
Any help appreciated,
J
I am developing a LocalReport using the ReportViewer component
and the report contains a subreport. The information is stored in a
typical master-detail table arrangement with a foreign key so the data
lends itself to this - fairly straightforward .
My problem is that the subreport requires the key value to be
passed to it - the key value is named iPersonID an integer. I know
how to set up the subreport in the report designer to look for an
incoming parameter, but I don't know how to pass that parameter in the
VB code. My event handler is shown below:
Dim Arg1 As SubreportProces singEventArgs
Public Sub DemoSubreportPr ocessingEventHa ndler(ByVal sender As Object,
_
ByVal e As SubreportProces singEventArgs)
Dim prmPersonID As ReportParameter InfoCollection
prmPersonID = Arg1.Parameters
Me.rvwrDraft.Lo calReport.SetPa rameters(prmPer sonID)
If InvestigationsD ataSet.dtAddHis tory Is Nothing Then
GetAddressHisto ryData()
End If
e.DataSources.A dd(New ReportDataSourc e("dtAddHistory "))
End Sub
It builds fine, but at run time, the reportview displays the message
"The iPersonID parameter is missing a value."
How do I set the value of the subreport input parameter in my VB code?
Any help appreciated,
J