ReportViewer for winforms desktop app

3 posts, 0 answers
  1. Edward
    Edward avatar
    1 posts
    Member since:
    May 2016

    Posted 01 Aug 2017 Link to this post

    I have created a report in the standalone report designer R2 2017. I previews perfectly. The problem is when I try to use the report viewer in my C# windows forms Desktop Application, (Visual Studio 2015 Community edition). The problem is something to do with the report source value. The relevant code I am using is:

             private void reportViewer1_Load(object sender, EventArgs e)
            {
                var typeReportSource = new Telerik.Reporting.TypeReportSource();
                typeReportSource.TypeName = "F:\\Work\\OnTarget2015\\Reports\\Report1";
                Telerik.ReportViewer.WinForms.ReportViewer reportViewer1;
                reportViewer1 = new ReportViewer();
                reportViewer1.ReportSource =  typeReportSource;
                reportViewer1.ReportSource.Parameters.Add(new Telerik.Reporting.Parameter(name: "StartDate", value: "1/1/2017"));
                reportViewer1.ReportSource.Parameters.Add(new Telerik.Reporting.Parameter(name: "EndDate", value: "8/1/2017"));
              
                this.reportViewer1.RefreshReport();
               
            }
        

  2. Yana
    Admin
    Yana avatar
    4915 posts

    Posted 04 Aug 2017 Link to this post

    Hi Edward,

    In this case you will need to use UriReportSource instead as it allows you to load reports created with the Standalone Report Designer, you could check the following topic on the different report sources and their usage: Report Sources

    I hope this will be helpful.

    Regards,
    Yana
    Progress 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. rathapong
    rathapong avatar
    1 posts
    Member since:
    Oct 2017

    Posted 06 Dec 2017 Link to this post

     

    private void reportViewer1_Load(object sender, EventArgs e)
            {

    var typeReportSource = new Telerik.Reporting.TypeReportSource();
                typeReportSource.TypeName = "ProjectName.ReporrtName, ProjectName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
                reportViewer1.ReportSource = typeReportSource;
                reportViewer1.RefreshReport();

    }

Back to Top