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

Add ReportViewer from code

2 Answers 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 2
Dan asked on 01 Sep 2009, 08:46 PM
If it is possible, I want to add a reportviewer (WinForms) dynamically at runtime from the code behind.  I have not been able to find any sample code snippets here that show how to do this in C#.  Is this even possible?

Thanks.
Dan

2 Answers, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 02 Sep 2009, 01:30 PM
Hello Dan,

The report viewer is a regular windows control so you can add it to your windows form just the same way you can dynamically add a Button for example. Little hint: Add the control at design time and see for example the generated code in the InitializeComponent method of the Form.

Of course, you need to set the Report property of the viewer and call the RefreshReport method so that a report is rendered in the viewer.

Hope this information helps.

Sincerely yours,
Milen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Eric
Top achievements
Rank 1
answered on 12 Jan 2012, 03:33 PM
Is there a code example for this anywhere?  I searched the forums and help but could not find anything...but my looking may not be the best ;)
Tags
General Discussions
Asked by
Dan
Top achievements
Rank 2
Answers by
Milen | Product Manager @DX
Telerik team
Eric
Top achievements
Rank 1
Share this question
or