IReportResolver for subreports

2 posts, 0 answers
  1. Scott Waye
    Scott Waye avatar
    168 posts
    Member since:
    Nov 2009

    Posted 09 Oct 2015 Link to this post

    Hi,

     I use a custom IReportResolver in combination with the ReportConnectionStringManager and it works well.  However my next requirement is to support subreports where the ReportSource property is set to a parameter, e.g. = Parameters.invoiceReport.Value.   This is a problem when attempting to update the connection string on the subreport, the name is given as the expression, not the evaluation of the expression.  It seems that I can evaluate the expression myself with a bit of work and checking the Http context request referrerUrl property, but looks a bit fragile.

     

    If you look at the code for ReportConnectionStringManager you can see that it assumes here:

    using (var xmlReader = System.Xml.XmlReader.Create(uriReportSource.Uri, settings))

    that the Uri is already evaluated, but it's not, it is the string "= Parameters.invoiceReport.Value".   Do you have any suggestions other than evaluating the expression myself?

     

    Thanks,

  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 12 Oct 2015 Link to this post

    Hi Scott,

    Expressions can be evaluated only once the report processing is started.

    My suggestion is to test settings the SubReport.ReportSource via binding and a custom function in which the sub report is obtained, modified and returned in an InstanceReportSource.


    To design reports with user functions in the Standalone Report Designer tool, functions will have to be created in an external assembly extending the tool's configuration - Extending Report Designer (there are tutorials linked at the bottom).
    On a side note, you can also use a custom data access layer in which you can specify the connection string in code. Then this data access layer can be used on designing and deploying reports.


    I hope the provided information is helpful.

    Regards,
    Stef
    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
Back to Top