ComponentOne ReportViewer for ASP.NET AJAX: ReportViewer for ASP.NET AJAX Quick Start > Step 2 of 3: Adding Reports to the Control

Step 2 of 3: Adding Reports to the Control

In the last step you created a new application and added the C1ReportViewer to the project. In this step you'll add a data source to your application and load a report into the C1ReportViewer control without using any code at all. Note that in this step you'll use the CommonTasks.xml example file which should be installed in the ComponentOne Samples folder.

Complete the following steps:

1.   Navigate to the Solution Explorer window, right-click the project name, and choose New Folder.

2.   Name the new folder "~/tempReports". This is the default value of the ReportsFolderPath property.

3.   In the Solution Explorer, right-click the App_Data folder and select Add Existing Item. The Add Existing Item dialog box will appear.

4.   In the Add Existing Item dialog box locate the C1Nwind.mdb file and click the Add button to close the dialog box and add the file to the project.

By default, the C1NWind.mdb file will be located in the Documents or My Documents folder at ComponentOne Samples\Common.

5.   In the Solution Explorer, right-click the project name and select Add Existing Item. The Add Existing Item dialog box will appear.

6.   In the Add Existing Item dialog box locate the CommonTasks.xml report definition file and click the Add button to close the dialog box and add the file to the project.

By default, the CommonTasks.xml file will be located in the Documents or My Documents folder at ComponentOne Samples\C1Report\C1Report\XML\CommonTasks.

Note: Report definition files are created with a separate utility, the C1ReportDesigner. The C1ReportDesigner works like the Access report generator, and is the same designer that ships with the C1Report component. The designer lets you create new reports from scratch or import existing ones from Microsoft Access and Crystal Reports. For more information on the C1ReportDesigner, see Working with the C1ReportDesigner in the Reports for WinForms documentation.

7.   Click once on the C1ReportViewer control so that it is selected and navigate to the Properties window.

8.   In the Properties window, set the FileName property to "~/CommonTasks.xml".

9.   In the Properties window, set the ReportName property to "01: Alternating Background (Greenbar report)".

The C1ReportViewer will now display this report at run time.

In this step you added data source to your application and loaded a report into the C1ReportViewer control without using any code. In the next (and last) step you'll run your application and see the C1ReportViewer control in action.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.