Simple Subreport Parameter not Working

4 posts, 1 answers
  1. Robert Bross
    Robert Bross avatar
    27 posts
    Member since:
    Oct 2012

    Posted 14 Jan 2015 Link to this post

    I have a simple Master/Detail type report that I'm trying to develop, however I'm running into a binding issues with relating the Detail to the Master. The only "advanced" part of this is that I am setting the datasource dynamically for the subreport and then creating a new InstanceReportSource. Could that possibly have something to do with it? Below is various screenshots of how I have everything setup and the results I'm getting. 

    1) A simple texbox on the report to display the value of the field I'm pulling from the datasource (This works)
    2) The Sub Report
    3) The Parameters of the ReportSource for the subreport. There is a single StudentId parameter. This is set to the same field that is being displayed (Item 1)
    4) The Report Parameters of the SubReport
    5) The output of the SubReport when it is run. The Date column is setup to use the StudentId parameter (Item 4)
    6) The code that is being used to set the DataSource for the SubReport

    Any ideas or suggestions would be Greatly appreciated! Thanks in advance!

  2. Robert Bross
    Robert Bross avatar
    27 posts
    Member since:
    Oct 2012

    Posted 14 Jan 2015 Link to this post

    Sorry, screenshot didnt post with the thread so attaching the file
  3. Answer
    Alena
    Admin
    Alena avatar
    1049 posts

    Posted 19 Jan 2015 Link to this post

    Hello Robert,

    The parameters configuration at step 3. in the Edit Parameters window is stored inside the ReportSource.Parameters collection.
    Then at step 6. you are creating a new report source and using it for the SubReport item:
    (telitems[0] as Telerik.Reporting.SubReport).ReportSource = new InstanceReportSource { ReportDocument = report };

    At this point you are no longer using the previously configured report source, meaning you are erasing all of the information stored at step 3. You will need to configure it once again adding the needed parameters and values to the InstanceReportSource.Parameters collection programmatically.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  4. Robert Bross
    Robert Bross avatar
    27 posts
    Member since:
    Oct 2012

    Posted 19 Jan 2015 in reply to Alena Link to this post

    This worked perfectly!! Thanks Nasko!!!
Back to Top