ReportConnectionStringManager with sub-reports issue

2 posts, 0 answers
  1. Al
    Al avatar
    187 posts
    Member since:
    Oct 2006

    Posted 29 Aug Link to this post


    I am using the code posted here to switch report db at runtime (trdp's designed outside of my application then hosted by http).

    One thing I picked up is that sub-reports are not handled properly, gives an error because the path is not found during this call in 'SetConnectionString' 

    subReport.ReportSource = this.UpdateReportSource(subReport.ReportSource);

    subReport.ReportSource above will be a simple filename (assuming the sub-report was designed in the same folder as the main report) which means the report file will not be found during deserialization.

    I can't post my working routine as it has become too customized but if you're doing this you must ensure that subReport.ReportSource is properly set to a full path before calling UpdateReportSource (or in UpdateReportSource). I hope this helps anyone who has this problem.


  2. Stef
    Stef avatar
    2926 posts

    Posted 29 Aug Link to this post

    Hello Al,

    When you design the report, the sub report may be specified by relative path. Relative paths are resolved based on the running application.

    Thus you will have to get the relative path (UriReportsource.Uri string) and resolve it depending on the current application. If it is a web application, you can use Server.MapPath to get the actual path to the file.

    Telerik by Progress
    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. DevCraft banner
Back to Top