I'm having some difficulty with the Report Parameters. I've been following previous posts and reviewing examples (in particular the WebReportParams) however my parameters are reset back to their default when the report is run. From my debugging it looks like the default constructor is being called when the report is processing which is overwriting the parameter values I previously set.
Here's some of my code to give you and idea of what I'm doing.
ASPX Page - in a button.click handler
Dim report As New BizportReports.PreBill(rcb_BillNo.SelectedValue)
report.ReportParameters(0).Value = "New Text"
Me.ReportViewer1.Report = report
Report Code - two constructors
Public
Sub New()
InitializeComponent()
Try
Me.DataSetTableAdapter1.Fill(Me.DataSet1.vTable)
Catch ex As System.Exception
System.Diagnostics.Debug.WriteLine(ex.Message)
End Try
End Sub
Public Sub New(ByVal p_BillID As Int16)
InitializeComponent()
Try
Me.DataSetTableAdapter1.FillWithParameters(Me.DataSet1.vTable, p_BillID)
Catch ex As System.Exception
System.Diagnostics.Debug.WriteLine(ex.Message)
End Try
End Sub
Lastly report parameter is accessed through;
Me
.Report.ReportParameters(0).Value
I tried removing the second constructor to make the BillID a Report Parameter as well, however the same issue occurred and the BillID was always reset.
Any ideas?
Cheers,
Karin