How Do I Pass Parameters to SubReport Sproc

3 posts, 0 answers
  1. AkAlan
    AkAlan avatar
    121 posts
    Member since:
    Jun 2009

    Posted 04 Nov 2009 Link to this post

     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. Guy Meredith
    Guy Meredith avatar
    4 posts
    Member since:
    Oct 2009

    Posted 12 Dec 2009 Link to this post

    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!
  3. Chris Gillies
    Chris Gillies avatar
    384 posts
    Member since:
    May 2006

    Posted 14 Dec 2009 Link to this post

    As pointed in previous thread of Guy's, this KB would get you in the right direction: 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.

Back to Top