Monday, 10 March 2014

Telerik reports integration with ASP.Net using telerik:ReportViewer

Telerik reports integration with ASP.Net using telerik:ReportViewer

1.Create a Class Library
2.Add New item-->Select telerik report control-->Enter Name -->Click OK
3. You will get prompt.
Click Yes to confirm the "Are you sure you want to cancel this wizard?" dialog.
-->You can click next and select data base and table and sql queries....
Now you can preview the report.
In the class file you can find "app.config", look for "connectionStrings". Inside "connectionStrings", you can find add tag, copy thhis tag and keep it some place.
Build the class library. Go to Bin folder and check for dll.
Now Create a ASP.Net Web Application
Add telerik dlls to VS 2010, so that you will get all controls...
C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q3 2012\Bin40
Add "Telerik.Web.UI.dll" from above path
Add New reference , select browse option -->Select the dll which we got from class library in the above solution...
Add new .aspx page.
Add a ReportViewer control from telerik
Go properties of ReportViewer control-->Click on "Reportsource"
You will get new window
Select : Type Name Option
Click On Select report type dropdown
Select default option
It will load Report class..extend that select report1.
<telerik:ReportViewer ID="ReportViewer2" runat="server">
<typereportsource
typename="MyClassT.Report1, MyClassT, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"></typereportsource>
</telerik:ReportViewer>
Open Web.config in web application, under " <connectionStrings>" add the tag which we took from class library
Ref:http://www.telerik.com/documents/TelerikReporting-LearningGuide.pdf