[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
 [Expand]Product Information
 [Expand]Get Started with DevExpress Reporting
 [Expand]Create Popular Reports
 [Collapse]Detailed Guide to DevExpress Reporting
   Introduction to Banded Reports
  [Expand]Provide Data to Reports
  [Expand]Use Report Controls
  [Expand]Shape Report Data
   Arrange Dynamic Report Contents
  [Expand]Customize Appearance
  [Expand]Add Navigation
  [Expand]Provide Interactivity
  [Expand]Add Extra Information
  [Expand]Merge Reports
  [Expand]Use Expressions
  [Expand]Store and Distribute Reports
  [Collapse]Reporting API
   [Collapse]Create 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]Use Report Scripts
 [Expand]Visual Studio Report Designer
 [Expand]Create End-User Reporting Applications
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on 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).

Perform the actions below to create and publish a report at runtime.

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