This article is only intended to help people who are new to users or who need devexpress xtrareports reports. To help more people, this article will not be written as a waste of time.ArticleYou can see what you don't want.
The devexpress xtrareports help document is provided in this Article. If you have read similar articles, skip this document.
Start with things.
This article consists of four steps:
- Create an applicationProgramAdd a report
- Build reports
- Output report
- View running results
I,Create an application
1. Start MS Visual Studio (2005, 2008, or 2010 ).
2. Create a Windows form application (or create a Windows Application in Visual Studio 2005 ).
3. In the project menu, select Add new project... (or press Ctrl + Shift + a) to call the Add new project dialog box.
4. In the dialog box, select xtrareport class v10.2 and click Add. In this way, a blank report is added to the application.
You can also select xtrareport wizard v10.2 to call the Report Wizard. This wizard helps you quickly create standard reports.
Ii. Build reports
- Visual Studio now displays the designer for creating a report (by default, the report name is xtrareport1 and will be used in this course ). Note: This report is derived from the xtrareport class, which is the basic class for all reports. You can find that this behavior is similar to the result of creating a form derived from the form class. (To continue creating a report, open the Toolbox pane (for example, press CTRL + ALT + x) and select the xrlabel control (on the dx.10.2: Report controls tab ), and drag it to the detail band of the report ).
Double-click the created tag and call its built-in editor that allows the input text. For example, type the classic Hello world! Statement. Then, use the xtrareports toolbar to adjust the label color and font options.
Switch to the preview tab (click the preview button at the bottom of the report designer ).
Similarly, if you want to view the HTML appearance of the report, switch to the HTML view tab.
Iii. output reports
- Switch to the form1 designer and add three system. Windows. Forms. button controls to the form. Modify their text to preview, print, and edit respectively.
Write the following click event handler for these buttons.
Private void button#click (Object sender, eventargs e) {// create a report. xtrareport1 report = new xtrareport1 (); // show the report's preview. report. showpreview ();} private void button2_click (Object sender, eventargs e) {// create a report. xtrareport1 report = new xtrareport1 (); // print the report. report. print ();} private void button3_click (Object sender, eventargs e) {// create a report. xtrareport1 report = new xtrareport1 (); // open the report in the End-User Designer. report. showdesigner ();}