I have created a report that contains parameters. I set it up so that the parameters would be hidden. I am trying to run this report and have it displayed in a report viewer on an asp page that I have. I basically created a page that will accept the parameters and then click a button to generate the report based on the parameters the user enters. Some of the parameters will be null at times.
I am running the program and I get a message. Can anyone please tell me what my problem is?
The message is: Object reference not set to an instance of an object.
Here's the code too:
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
setParams()
ReportViewer1.ProcessingMo
de = Microsoft.Reporting.WebFor
ms.Process
ingMode.Re
mote
ReportViewer1.ServerReport
.ReportSer
verUrl = New System.Uri("
http://srmha-96648582/ReportServer")
ReportViewer1.ServerReport
.ReportPat
h = "/Report Project6/CCD"
(The message occurs on this next line)
RptParameters(0) = New Microsoft.Reporting.WebFor
ms.ReportP
arameter("
user", txtUserName1.Text)
RptParameters(1) = New Microsoft.Reporting.WebFor
ms.ReportP
arameter("
keyword", txtKeyWord.Text)
RptParameters(2) = New Microsoft.Reporting.WebFor
ms.ReportP
arameter("
userlastna
me", userLastName)
RptParameters(3) = New Microsoft.Reporting.WebFor
ms.ReportP
arameter("
userfirstn
ame", userFirstName)
RptParameters(4) = New Microsoft.Reporting.WebFor
ms.ReportP
arameter("
custlastna
me", custLastName)
RptParameters(5) = New Microsoft.Reporting.WebFor
ms.ReportP
arameter("
custfirstn
ame", custFirstName)
RptParameters(6) = New Microsoft.Reporting.WebFor
ms.ReportP
arameter("
startdate"
, txtStartDate.Text)
RptParameters(7) = New Microsoft.Reporting.WebFor
ms.ReportP
arameter("
enddate", txtEndDate.Text)
ReportViewer1.ServerReport
.SetParame
ters(RptPa
rameters)
ReportViewer1.ServerReport
.Refresh()
End Sub