[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]Get Started with DevExpress Reporting
 [Expand]Create Popular Reports
 [Expand]Detailed Guide to DevExpress Reporting
 [Expand]Visual Studio Report Designer
 [Collapse]Create End-User Reporting Applications
   Cross-Platform Reporting
  [Expand]WinForms Reporting
  [Collapse]WPF Reporting
   [Expand]Print
   [Expand]Document Preview
   [Collapse]End-User Report Designer
    [Expand]Quick Start
    [Collapse]GUI
     [Collapse]Interface Elements
       Toolbar
       Control Toolbox
       Field List
       Report Explorer
       Report Gallery
       Group and Sort Panel
       Properties Window
       Design Surface
       Script Editor
       Query Builder
      Document Preview
     [Expand]Report Wizard
     [Expand]Data Source Wizard
    [Expand]API and Customization
   [Expand]Application Security
   [Expand]Application Appearance
    Application Deployment
   [Expand]Localization
    End-User Documentation
  [Expand]Web Reporting
  [Expand]WCF Report Service
  [Expand]Discontinued Platforms
   Localization
   Redistribution and Deployment
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Script Editor

The Script Editor allows end-users to write code for specific event handlers in the End-User Report Designer to adjust the behavior of report controls, bands or the report itself.

This topic describes the basics of using scripts, the Script Editor interface and shows how to use scripting in a report.

Expanded Scripts Overview

The Script Editor provides end-users with the capability to write and execute scripts at runtime when a report is generated. Note that this feature is primarily intended to be used by advanced end-users who want to slightly customize a report in the End-User Report Designer.

The Script Editor supports C# and Visual Basic .NET scripting languages. This means that the scripting language is independent from the language used to create the report. You can specify the language using the XtraReport.ScriptLanguage property. The selected scripting language should be the same for all scripts used in a report.

Expanded Maintaining Scripts

Each report element has its own set of events, which are individual for each element type. To handle an event of a report element, do one of the following.

  • Select the required report element on the Design Surface. In the Properties Panel, expand the Scripts property and click the plus button for the event.

  • Click the Scripts button () in the Toolbar to display the Script Editor. Choose the required report element in the dedicated drop-down list at the left top of the Script Editor. Then, select one of the available events in another list at the right top.

After the event is specified, a code template is automatically generated in the current scripting language and added in the Script Editor.

To check for errors in the report's script, click the Validate button. The validation result is displayed in the errors panel at the bottom of the Script Editor. Double-click the error item in the panel's list to go to the corresponding line of code. If all scripts are valid, the errors panel is empty.

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