The best way to handle this scenario would be to create some business logic. Crate a method that takes two DateTime parameters, calling your Stored Procedure, and returns a DataTable or DataSet. This is the best-practice approach since it allows you to create separate layers in you project that can be maintained independently without breaking other functionality.
Once you crate the business logic, you can add a ObjectDataSource
to your Report that will call that method with the two DateTime parameters.
Now, you have a choice to make. You can have the user enter the parameters on your ASPX page, but then you need to first pass the parameters into the Report
- so the report can utilize them when making a call to your data access layer.
A simpler approach is to add two Report Parameters
into the report itself, so the user enters the data directly into the Report using the ReportViewer.