Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Collapse]Scheduler
   [Expand]Product Information
   [Expand]Getting Started
   [Collapse]Fundamentals
    [Expand]Scheduler Elements
    [Expand]Scheduler Structure
    [Expand]Appointments
     Resources for Appointments
    [Expand]Views
    [Expand]Data Binding
    [Expand]Mappings
    [Expand]Supported Formats
    [Expand]Services
    [Expand]Time Zones
     Printing
    [Collapse]Scheduler Reporting
      Reporting Technique
      Scheduler Report Controls and Components
      Scripting
      Can Shrink and Can Grow Features
      SmartSync Feature
      Scheduler Report Templates
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Scripting

The End-User Report Designer enables end-users to write report scripts. Scripts are custom event handlers that can be added for specific events of Scheduler report controls, bands, Scheduler views or a report itself.

Expanded How to Write a Script

To write a script, switch to the Script tab of the End-User Designer, select a report element in the drop-down list as illustrated below and specify one of its available events in the next drop-down list:

To check for errors in a report script, click the Validate button. If errors are found, they are listed in the Error List panel.

To execute the script, switch to the Preview tab:

Note

The XtraReport.ScriptLanguage property specifies a language (C# - default, Visual Basic .NET or JScript .NET) that is used by all scripts in a report. The scripting language is independent from the language used to create the report.

To learn more about report scripts, refer to the Scripting in XtraReports topic.

Expanded Script Examples

The following events are supported in scripts for the TimeCellsControlBase descendants:

  • AppointmentViewInfoCustomizing
    The code below makes the appointment text bold.
  • CustomDrawAppointment
    The code below displays the appointments that start past 12 PM as rectangles with gradient fill.

  • CustomDrawAppointmentBackground
    The code below fills half of the appointment rectangle in yellow.

  • CustomDrawTimeCell
    The code below draws red rectangles in place of time cells.
  • InitAppointmentDisplayText
    The code below displays appointment duration in square brackets at the end of the appointment text.
  • InitAppointmentImages
    The code below inserts an exclamation point in the appointment rectangle.
Note

Use the CustomDrawObjectEventArgs.Cache property to paint shapes, write a text and insert images. Do not use the CustomDrawObjectEventArgs.Graphics object in Scheduler Reports.

Expanded See Also

How would you rate this topic?​​​​​​​