Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Collapse]Reporting
 [Expand]Product Information
 [Collapse]Creating Reports in Visual Studio
  [Expand]Adding a Report to Your .NET Application
  [Expand]Getting Started with DevExpress Reporting
  [Collapse]Detailed Guide to DevExpress Reporting
   [Expand]Storing and Distributing Reports
   [Expand]Providing Data to Reports
   [Expand]Shaping Report Data
   [Expand]Report Navigation, Interactivity and Appearance
   [Collapse]Reporting API
    [Collapse]Creating Reports in Code
      How to: Create a Simple Static Report (Runtime Sample)
      How to: Create a Master-Detail Report (Runtime Sample)
      How to: Create a Cross-Tab Report (Runtime Sample)
      Report Class Hierarchy
      Report Events
    [Expand]Using Report Scripts
  [Expand]Detailed Guide to Visual Studio Report Designer
 [Expand]Creating End-User Reporting Applications
 [Expand]API Reference
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Create a Simple Static Report (Runtime Sample)

This tutorial illustrates how to create a simple report that is not connected to an external data source, and contains a single label that displays static text.

For a code sample demonstrating the creation of a data-aware report, see How to: Create a Master-Detail Report (Runtime Sample).

To create and publish a report at runtime, do the following.

Expanded Create a Reporting Application

To get started with this tutorial, open a reporting application or create a new one from scratch. To learn how to create a reporting application on the platform of your choice, see Adding a Report to Your .NET Application.

Most reports you create are platform-agnostic, which means that you can use them later in applications created under any of the supported platforms. To learn more, see CodeDOM Serialization.

Expanded Create a Report in Code

The following code illustrates how to create a simple "Hello, World!" report at runtime by creating a new class inherited from the XtraReport class.

Before running this code, add all required assemblies to the References list of your project. The required assemblies may be different, depending on your application's target platform. To learn more, see Application Deployment.

The report in this sample contains an XRLabel (named HelloWorldLabel), which is placed onto a Detail band. The PageHeader and PageFooter bands do not contain any controls and are added to the report only for illustration.

Expanded Preview and Publish the Report

The following image shows the results.

To learn how to preview, print and/or export reports in an application depending on its target platform, see Cross-Platform Reporting.

Expanded See Also

Is this topic helpful?​​​​​​​