Creating a Simple Standard Telerik Report
This is a step-by-step guide to creating a simple standard report using Telerik’s Reporting tool. It requires the following: Telerik Reporting has been installed. Northwind database has been setup on SQL Server 2008 and of course, Visual Studio 2010,
1. Click File – New Project.
2. Change Project Name to ‘MyReportAppLib’.
3. Change Solution Name to ‘MyReportApp’.
4. Click OK.
The Solution and Project files are created.
5. Delete the default Class1.cs file that is created.
6. File – Add New Item.
7. Locate and single-click on Telerik Report Q2 2010
8. Change the Name to ‘MyReport1.cs’.
9) Click the Add button.
The Report and a reference to Telerik.Reporting are created. the Telerik Report wizard is then presented.
10. Click the Next button.
11. Click the New Report radio button and click the Next button.
12. Click the Add New Data Source… button.
13. Click Sql Data source
14. Change the Data Source Name if desired. I kept the default which is sqlDataSource1.
15. Click the OK button.
You will be brought to the Choose Your Data Connection dialog where you will select the Data connection for the Northwind database. If you don’t have one, click the New Connection… button.
16. Select the Data Connection for the Northwind database.
17. Click the Next button.
18. Click the radio button ‘Yes, save this connection string with the following name: ‘
19. Keep or rename the Connection string. In my case I kept the default which was ‘Northwind’.
20. Click the Next button.
21. Enter the Select SQL Statement or use the QueryBuilder button. For this example, I used the following SQL:
SELECT CategoryID, CategoryName, Description
22. Click the Next button.
23. Click the Finish button.
24. Now that we’ve completed the Data Source-related dialog, we’re now back in the Telerik Report Wizard. With the Data Source now created, be sure it (sqlDataSource1 as above) is still selected and click the Next button.
25. For the report type, select Standard and click the Next button.
26. Drag the 3 fields from the Available fields tree list to the Detail list.
27. Click the Next button.
28. Click Left Aligned as the Layout and unselect Adjust report items to fit available space. Click the Next button.
29. Select Civic as the Stylesheet.and click the Next button.
30. Click the Finish button.
31. Click the Preview tab.
32. Right-click the MyReportAppLib project and click Rebuild to compile the project.
With the report already completed, We can display it in either a Web or Windows viewer. To continue with this exercise, I will use a Web viewer.
1. Click File – Add – New Project.
2. Click ASP.NET Web Application and change the Name to ‘MyReportApp.Web.UI’ and click the OK button.
You are now going to have two projects in the MyReportApp Solution.
3. Add a reference to the MyReportAppLib project by right-clicking on the MyReportApp.Web.UI project and clicking Add Reference. In the Projects tab, select MyReportAppLib and click OK.
4. Create a Views folder by right-clicking on the MyReportApp.Web.UI project in the Solution Explorer and clicking Add – New Folder.
5. Right-click on the Views folder and click Add – New Folder. Call this folder ‘Reports’
6. Right-click on the Reports folder and click Add – New Item. To simplify things, just select Web Form and call it CategoriesListing.aspx. Click the Add button.
7. Drag the ReportViewer from the Telerik Reporting Tab of your toolbox.
and paste into your .aspx page (must be anywhere inside the <form id=”form1” runat=”server”>
8. Switch to the Design tab and click on the ReportViewer (ReportViewer1) to select it.
9. Locate the Report property in the Properties Window and open the corresponding Drop-down list and select the MyReport1 Report we created earlier.
10. Double-click the CategoriesListing.aspx.cs file and put the following code in the Page_Load method.
protected void Page_Load(object sender, EventArgs e)
11. Very Important Step! Copy the Connection String from the app.config file of the MyReportAppLib project into the connectionStrings section of the MyReportApp.Web.UI’s web.config file.
To test, just right-click on CategoriesList.aspx and click View in Browser.