Create and View Reports in an ASP.NET Application
- 2 min to read
This topic describes how an end-user can create and view a report at runtime in an ASP.NET application.
Copy Predefined Report
Copy a predefined report using the Copy Predefined Report () button and then edit it.
Create a New Report from Scratch
To create a report at runtime, do the following.
- Choose the Reports item in the Navigation.
- Click New.
In the invoked New Report Wizard dialog, specify the following.
- Display Name - the report's name.
- Data Type - the business object type to be used in the report. Only the types that have the DefaultClassOptionsAttribute or VisibleInReportsAttribute attribute applied can be chosen.
- Click Create.
As a result, the Detail View will be invoked. This Detail View contains a single View Item - the ReportDesignerDetailItem, which creates the ASPxReportDesigner control used to design a report. The designer provides advanced report layout customization options (refer to the ASP.NET Report Designer documentation to learn more).
When the VisibleInReports attribute is applied to a business class property, it specifies whether or not the target property is visible in the Report Designer field list.
You can watch the tutorial on the DevExpress YouTube Channel: DevExpress XAF: Web Report Designer
Current limitations of the ASPxReportDesigner in XAF
The following functionality is not supported:
After a report is saved in the designer, it is added to the Reports List View. You can click a report to preview it. The WebReportsController.PreviewInReportViewerAction will be executed, and a Detail View will be displayed. This Detail View contains a single View Item - the ReportViewerDetailItem, which creates the ASPxDocumentViewer control used to display a report.
The designer and viewer are displayed in a popup by default. You can change this behavior using the ReportsAspNetModuleV2.DesignAndPreviewDisplayMode property. If you change the mode from Popup to DetailView in the Application Designer, the designer and viewer will be displayed in the main window.