Reporting Q1 2016 - WPF - UriReportSource

3 posts, 0 answers
  1. Thomas
    Thomas avatar
    2 posts
    Member since:
    Feb 2016

    Posted 08 Apr Link to this post


    I have a very simple scenario where I want to load a report created with the standalone designer in a WPF ReportViewer.

    [Code Behind for Main Window]

                ReportViewer1 = new Telerik.ReportViewer.Wpf.ReportViewer();
                Telerik.Reporting.UriReportSource uriReportSource = new Telerik.Reporting.UriReportSource();
                uriReportSource.Uri = @"./yop.trdx";
                this.ReportViewer1.ReportSource = uriReportSource;


    The ReportViewer is shown with the correct theme but the specified report (yop.trdx) failed to load. The report has only a static textbox in it (no datasource bindings)

    My xaml look like:

    <Window x:Class="App2.MainWindow"
                    Title="MainWindow" Height="350" Width="525"   telerikControls:StyleManager.Theme="Vista">
            <tr:ReportViewer x:Name="ReportViewer1" HorizontalAlignment="Stretch"  VerticalAlignment="Stretch"/>


    Could you please help me?



  2. Thomas
    Thomas avatar
    2 posts
    Member since:
    Feb 2016

    Posted 08 Apr in reply to Thomas Link to this post

    Never mind. Removed the ReportViewer code behind instanciation and got it working.  
  3. DevCraft R3 2016 release webinar banner
  4. Stef
    Stef avatar
    2923 posts

    Posted 11 Apr Link to this post

    Hello Thomas,

    The UriReportSource.Uri string should be a relative path to the TRDX file based on the application's execution folder, or it can be an absolute path.

    Other approaches for deploying TRDX files are elaborated in How to: Deploy a report created with Standalone Report Designer. Details about the report sources used in the article - Report Sources.

    I hope this information is helpful.

    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