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

How Do I Pass Parameters to SubReport Sproc

2 Answers 220 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
AkAlan
Top achievements
Rank 2
AkAlan asked on 04 Nov 2009, 07:28 PM

 I need to be able to pass parameters to a subreport sproc at run time, I would perfer session variables but I don't really care, just need to pass the variables. 
 

Here is what I’m talking about. I need a report that shows Maintenance, Oil usage and Meter hours against Power Generators located at 15 different sites. The data needs to be filtered for what ever date range the user passes, usually a month . I don’t use a report viewer, just export the report directly to pdf and let the user save the report. They put a begin date and end date into two text boxes, and clicks the report button. 

 

Main Report datasource is SqlDatasource with a Sproc, it returns Site Name and SiteID, No  parameters, I want to see all sites data in this particular report.

 

Subreport 1 - Oil usage for that site. Table has fields SiteID, DateAdded, QuantityAdded

Parameters(@BeginDate, @EndDate)

 

Subreport 2  - Meter Hours for that site . Table has fields SiteID, ReadingDate, MeterReading

Parameters(@BeginDate, @EndDate)

 

Subreport 3  Maintenance performed

Parameters(@BeginDate, @EndDate)

 

How do I make this work with Telerik Reports??????

 

Right now I have hard coded the stored procedures as this is the first report I have created but next month I need to be able to provide the user with a way of filtering the report. I am in a real jam here. Any help would be greatly appreciated. Thanks

2 Answers, 1 is accepted

Sort by
0
Guy Meredith
Top achievements
Rank 1
answered on 12 Dec 2009, 07:42 AM
I don't know the answer, sadly, but have a very similar requirement. I've searched the documentation but cannot find the answer. If you do find out, please let us know how you did it. Thanks!
0
Chris Gillies
Top achievements
Rank 1
answered on 14 Dec 2009, 09:08 AM
As pointed in previous thread of Guy's, this KB would get you in the right direction: http://www.telerik.com/support/kb/reporting/designing-reports/using-data-source-with-parameters-in-telerik-reporting.aspx. The approach is exactly the same with subreports, the only thing different is that you're going to use the NeedDataSource event either of the subreport item itself or of the report used as subreport, depending on your exact needs.

Cheers.
Tags
General Discussions
Asked by
AkAlan
Top achievements
Rank 2
Answers by
Guy Meredith
Top achievements
Rank 1
Chris Gillies
Top achievements
Rank 1
Share this question
or