How to: Print the ASPxScheduler Using a Report Preview (Step-by-Step Guide)
5 min to read
This document describes how to create a simple report and preview it before sending it to a printer. To create a printout for ASPxScheduler, create an XtraSchedulerReport class descendant instance that uses ASPxScheduler data and print it using the ReportViewer Web control.
This step is required to create a sample application that contains a data-bound ASPxScheduler control.
Create a new Outlook Inspired Web Application for ASP.NET WebForms using the Project Wizard and name it SchedulerReportPreviewTest.
Steps 1-3. Add a Scheduler Report to the Web Application
Create a new folder named Reports in your application.
Right-click the newly created folder in the Solution Explorer window and select Add DevExpress Item | New Item....
In the DevExpress Template Gallery dialog, select Web Scheduling section and click the Scheduler Report thumbnail to create the XtraSchedulerReport1.cs file and add it to the project:
A new blank Scheduler report is added to your application. Visual Studio shows the designer for the newly created report (it is named XtraSchedulerReport1 by default). The report descends from the XtraSchedulerReport class, which is the base class for all reports.
Steps 4-9. Load a Report from a Template
To create a report from scratch, skip to Step 10.
To create a report, use one of the templates from the gallery of ready-to-use report layout templates. Connect to this gallery at design time within Visual Studio by clicking the report's smart tag, and in the invoked Report Tasks list, select the Load Report Template... link.
In the invoked Report Templates dialog, select the template and click Load. You can also search for a specific template using the search box.
The selected report is loaded to the Visual Studio designer.
Add a new web user control to the Reports folder by right-clicking it in the Solution Explorer and selecting Add New Item | Web Forms User Control in the invoked menu. Name the control ReportPreview.ascx.