This is a migrated thread and some comments may be shown as answers.

Report Parameters

3 Answers 246 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Doug Arneson
Top achievements
Rank 1
Doug Arneson asked on 13 Nov 2008, 06:49 PM

I am trying to create a parameterized report using the following data source:

SELECT SITE, COUNT(SITE) AS #EVENTS, SUM(WORKTIME) AS WORKTIME, SUM(TOTALEVENTTIME) AS EVENTTIME
FROM EDB_RECORDS

WHERE RECEIVEDDATE BETWEEN '2008-10-01' AND '2008-10-31'

GROUP BY SITE

ORDER BY SITE

I can get the report to display with the WHERE statement as written, but I need to change the WHERE statement to: WHERE RECEIVEDDATE BETWEEN @BDATE AND @EDATE. The intent is to have the user enter the beginning date and the ending date.

I set up a web page to pass the values to the report, but was having trouble putting in the code to check for the parameters using an example I found in the forums.

Any assistance will be greatly appreciated.

I’m using VS2008 using VB, MS SQL Server 2005 and .NET 3.5

Thanks,

Doug

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 14 Nov 2008, 01:54 PM
Hello Doug,

We believe that this the video is what you're looking for. We're working with the SelectCommand.Parameters[] collection and create a public property that is used in the calling form containing the ReportViewer.
Please review the video carefully and try to implement this in your application. There is nothing different here as it is not the ReportViewer you're working with, but rather with the data objects, which are the same no matter of whether you're using Crystal SSRS or Telerik Reporting.
Moreover our reports are standard .net classes and you can work with them in the same manner.

Best wishes,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Reza
Top achievements
Rank 1
answered on 10 Dec 2008, 08:11 AM
Dear Sir ,

I followed this video and then I did an example base on it . but some where in this video you set a default value for parameter @LName  in report designer and then you select data explorer option for retreiving data source columns ! In my example If I don't assign a default value for my parameter and select data explorer  the report designer show me an error dialog box which says :

stored procedure or function 'sp_GetDepartmentsById' expected parameters @Id which was not supplied . and no data source columns would retreive for me .

May you please tell me about this problem ?

Thanks alot .

0
Doug Arneson
Top achievements
Rank 1
answered on 10 Dec 2008, 01:16 PM
In this case, look at the SqlDataSource parameters. Ensure that your SqlDataSource parameters collection has values for all your
SP parameters. Sometime the wizard doesn't get your parameters when using SP and you have to set them manually. Also when you do be sure to set the SourceColumn to the correct column required in the SP.


Doug
Tags
General Discussions
Asked by
Doug Arneson
Top achievements
Rank 1
Answers by
Steve
Telerik team
Reza
Top achievements
Rank 1
Doug Arneson
Top achievements
Rank 1
Share this question
or