Brief Introduction to DevExpress Report
- DevExpress Report is an important component of the DevExpress package. It helps us easily design and print beautiful reports and reports.
- The same DevExpress Report can be designed to be used in different types of programs (such as WinForm and Asp.net.
- The use of the DevExpress Report component is basically the same as that of Windows reports for quick start. At the same time, DevExpress Report provides a series of Report controls for use during design. Such as XRLable, XRCheckBox, and XRPictrueBox. Note: All DevExpress Report controls start with XR ).
How to create and print a preview Report?
See source code
1. Create a project and add the XtrReportClass file (v9.1 indicates the version number ),
2. Open the report design page, add an XRLabel to Detail, and set its properties. (The specific method is the same as using other controls)All available Report Controls are in the DX.9.1: Report Controls toolbox.
3. Print the current reportAs mentioned above, the same report can be directly used without any modification in different types of programs, but it is different in display.
3.1 print and preview in WindowsWhen printing or previewing a report in Windows, you can directly use the following code to display the report: HelloXtraReport report = new HelloXtraReport (); // 1 print the preview report. showPreview (); // 2 print the report directly. print (); // 3. Edit Report in the running state. showDesigner ();
3.2 print and preview on the WebIt may be a little troublesome to use in Web programs, but it is relatively easy.
1
Add ReportToolbar to the page
And ReportViewer. ReportToolbar provides a set of tool commands to control the operations performed by the ReportViewer view. The most important attribute of ReportToolbar is the ReportViewer attribute, which specifies a report view. For example, if ReportViewer is used to display the Report, you can specify the Report attribute of ReportViewer (select from the list). For example, after setting, open the page in a browser and preview the Report.
4. Export a reportYou can use the export button in the toolbar provided by the Report to perform the export operation. Of course, you can also use the code to control the details.