Cant Pass a parameter into the ReportViewer of a web page.

Currently I have a page that has a report that loads the report getting the information from a stored procedure.

I need to pass a date into the stored procedure for the report to display the results. If I eliminate the parameter from the stroed procedure and the report I can get the report to load on the web page.

But I don't want to hard code values. I want the user to pass in the values for the criteria of the report. In this case a simple date range.

Here is the code:

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load

Dim StartDateAsNew ReportParameter("StartDate","3/1/2006")

Dim p()As ReportParameter = {StartDate}

ReportViewer1.ServerReport.SetParameters(p) <-- it stops on this line.

EndSub

Error returns --> MissingReportSourceException was unhandled by user

Any help that you can provide I would appreciate it.

Thanks

Vern

[2058 byte] By [VernonKercher] at [2007-12-28]
# 1
MissingReportSourceException means that you have not yet supplied a definition for the report, so the report viewer can't validate parameters. Make sure you have set ReportViewer.ServerReport.ReportPath before calling SetParameters().
BrianHartman-MSFT at 2007-9-4 > top of Msdn Tech,Visual Studio,Visual Studio Report Controls...
# 2
How do you set the definition?
Delusion7 at 2007-9-4 > top of Msdn Tech,Visual Studio,Visual Studio Report Controls...

Visual Studio

Site Classified