This section will lead you through the creation of a Web form that uses the C1WebReport control. By following the steps outlined below, you will be able to create a rich, user-friendly Web form.
Complete the following steps:
1. Start a new ASP.NET project using the New Web Site dialog box as shown below:
2. From the Toolbox, double-click the C1WebReport control to add it to the form.
3. Click the smart tag () located at the top right corner of the C1WebReport control to open the C1WebReport Tasks menu.
4. In the C1WebReport Tasks menu, click Load Report. The Select a report dialog box appears; you can select a report definition file and the report name within the file.
Alternatively, the Select a report dialog box can be accessed by clicking the Load Report link at the bottom pane of the Properties window.
5. Click the ellipsis button and locate the NWindEmbedPics.xml file (by default, it is located in the Documents or My Documents folder at ComponentOne Samples\C1Report\C1Report\XML\SampleReports\NWindEmbedPics.xml).
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.
6. Select the NWindEmbedPics.xml file and click OK.
7. From the Select a report dialog box, choose the Employees report from the Report drop-down list.
8. After selecting the file and the report, click the Load button to load the report into the control.
9. Click OK to close the dialog box.
Run the application and observe the following:
In a few seconds, the browser appears with the report:
That is all it takes to add reports to your Web pages.
At this point, take some time to experiment with some of the other properties of the control. For example, change the value of the Paged and Scrollable properties to see their effect on the report. Also, try changing the control border, and colors, or loading different reports.
Save your project – you'll expand on this application in the WebReports for ASP.NET Tutorials, gradually adding more advanced features such as displaying multiple reports, changing report parameters, exporting and e-mailing reports, and customizing the navigation bar.
|