Using subreport binding to set ReportSource

3 posts, 0 answers
  1. Tracy
    Tracy avatar
    13 posts
    Member since:
    Nov 2010

    Posted 05 Jun 2015 Link to this post

    I am using Telerik Report Designer, and I have a report that has many nested subreports. The report works fine, but I am trying to change one subreport based on user input.  I attempted to do this by adding a Binding to ReportSource like this:

     

    = IIf(Parameters.Images.Value,"ShowImages.trdx", "NoImage.trdx")

    When I run this I get the error

     

    I've tried different variations of the Expression, including the full path of the trdx file,  but get the same error. Is there a way to change which file is referenced?

     

    Thanks,

    Tracy

  2. Nasko
    Admin
    Nasko avatar
    1045 posts

    Posted 08 Jun 2015 Link to this post

    Hello Tracy,

    The SubReport.ReportSource Property expects a value of type ReportSource, not a string.
    You have the following options to set the report based on the report parameter value:

    1. Use the SubReport.ReportSource expression without any bindings: screenshot.

    2. Bind the value of the ReportSource.Uri property to your expression.

    3. Create a User Function which returns a valid report source and bind the result to the ReportSource property.


    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Tracy
    Tracy avatar
    13 posts
    Member since:
    Nov 2010

    Posted 11 Jun 2015 Link to this post

    Thanks, I'm not sure how I missed I could use an Expression in the report source but this now works exactly as I need it to.
Back to Top