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]Office File API
[Collapse]Reporting
 [Expand]Product Information
 [Expand]Getting Started with DevExpress Reporting
 [Expand]Creating Popular Reports
 [Collapse]Detailed Guide to DevExpress Reporting
   Introduction to Banded Reports
  [Expand]Providing Data to Reports
  [Expand]Using Report Controls
  [Expand]Shaping Report Data
   Laying out Dynamic Report Contents
  [Expand]Customizing Appearance
  [Expand]Adding Navigation
  [Expand]Providing Interactivity
  [Expand]Adding Customary Information
  [Expand]Merging Reports
  [Expand]Using Expressions
  [Expand]Storing and Distributing Reports
  [Collapse]Reporting API
   [Collapse]Creating Reports in Code
     Create a Simple Static Report (Runtime Sample)
     Create a Master-Detail Report (Runtime Sample)
     Create a Cross-Tab Report (Runtime Sample)
     Report Class Hierarchy
     Report Events
   [Expand]Using Report Scripts
 [Expand]Visual Studio Report Designer
 [Expand]Creating End-User Reporting Applications
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
This documentation page describes implementations made in our v17.2 release cycle. To learn about functionality shipping with v18.1, navigate to our updated help file experience at docs.devexpress.com. Learn More

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 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?​​​​​​​