Original: DevExpress Xtrareports get started four create a WEB report
This article is only to help the first contact or need to devexpress Xtrareports report of the people to use, in order to help more people will not like me to waste time to write this article, master don't want to see please pass by
This article is to devexpress xtrareports help documentation, as seen in similar please skip.
Talk less about getting started.
I. Create a WEB report and bind the data
- starts MS Visual Studio (2005, 2008, or 2010).
- Create a new ASP. NET WEB application.
- To add a new report to the WEB application.
- Now you need to add the dataset to the Web application.
Note
You can not add datasets to a report in the same way as in getting started two. Instead, you first manually add the dataset to the application and assign it to the report's Xtrareportbase.datasource property.
To do this, in the Project menu, choose Add New Item ..., in the dialog box that is called, select DataSet, and then click the Add button.
- Then, in the Open DataSet Designer, drag and drop the Categories data table from the Server Explorer panel onto the designer's interface.
Saves the changes you made and exits the DataSet Designer.
- Now, switch to the report's designer and click the smart tag for the report. In the list of actions invoked, specify the dataset you created as the Xtrareportbase.datasource of the report.
After this step, two additional properties are automatically specified: The Xtrareportbase.datamember property value is set to the Categories,xtrareportbase.dataadapter property value is set to Categoriestableadapter.
- Now that the report is bound to data, you can adjust the layout of the report by dragging the fields you want from the field list to the report band. For this guide, we copy the report created in the Getting Started two, which has the following layout.
checks to see if the report layout you created meets the requirements for exporting to HTML: report controls cannot intersect each other. Otherwise, the HTML output will become confusing. If the Xtrareport.showexportwarnings property is enabled (enabled by default), then the intersecting controls are drawn in red. Therefore, you should rearrange them as shown in.
Second, display the report in the webpage
- Switch to the Default.aspx tab, and click the Design button at the bottom of the page to view the designer for this page.
- To embed the report in a Web page, we expand the Dx.10.2:reporting Toolbox tab and drag and drop the ReportViewer control onto the Web page. To provide navigation tools for reports, you can also add Reporttoolbar controls.
Attention
After the Reporttoolbar or ReportViewer control is added to the WEB application (the first time only), the application's Web. config file is changed.
- To link the ReportToolbar1 and ReportViewer1 controls together, you need to set the Reporttoolbar.reportviewer property to an existing ReportViewer1 object.
- To specify the report object that will be rendered through the ReportViewer1 control, you need to set its Reportviewer.report property to XtraReport1.
Iii. viewing the results of the operation
The WEB report is now ready. Run the application and view the ASP. NET page created in the system's default Web browser. If the Default.aspx page is not specified as the startup page for the project, then right-click the page in Solution Explorer and select Set As Start Page menu item and run it again.