This is a migrated thread and some comments may be shown as answers.

ReportViewer for winforms desktop app

2 Answers 314 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 01 Aug 2017, 05:50 PM

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 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 04 Aug 2017, 02:41 PM
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
0
rathapong
Top achievements
Rank 1
answered on 07 Dec 2017, 02:40 AM

 

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();

}

Tags
General Discussions
Asked by
Edward
Top achievements
Rank 1
Answers by
Yana
Telerik team
rathapong
Top achievements
Rank 1
Share this question
or