Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.
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.
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.
privatevoiddayViewTimeCells1_CustomDrawAppointment(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e) {
DevExpress.XtraScheduler.Drawing.AppointmentViewInfo viewInfo = e.ObjectInfo as DevExpress.XtraScheduler.Drawing.AppointmentViewInfo;
if (viewInfo.Interval.Start.TimeOfDay > new TimeSpan(12, 0, 0)) {
e.Cache.FillRectangle(e.Cache.GetGradientBrush(e.Bounds, Color.Gray, Color.White, System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal), e.Bounds);
e.Handled = true;
}
}
PrivateSub dayViewTimeCells1_CustomDrawAppointment(ByVal sender AsObject, ByVal e As DevExpress.XtraScheduler.CustomDrawObjectEventArgs)
Dim viewInfo As DevExpress.XtraScheduler.Drawing.AppointmentViewInfo = TryCast(e.ObjectInfo, DevExpress.XtraScheduler.Drawing.AppointmentViewInfo)
If viewInfo.Interval.Start.TimeOfDay > New TimeSpan(12, 0, 0) Then
e.Cache.FillRectangle(e.Cache.GetGradientBrush(e.Bounds, Color.Gray, Color.White, System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal), e.Bounds)
e.Handled = TrueEndIfEndSub
CustomDrawAppointmentBackground
The code below fills half of the appointment rectangle in yellow.
privatevoiddayViewTimeCells1_InitAppointmentImages(object sender, DevExpress.XtraScheduler.AppointmentImagesEventArgs e) {
DevExpress.XtraScheduler.Drawing.AppointmentImageInfo info = new DevExpress.XtraScheduler.Drawing.AppointmentImageInfo();
info.Image = SystemIcons.Warning.ToBitmap();
e.ImageInfoList.Add(info);
}
PrivateSub dayViewTimeCells1_InitAppointmentImages(ByVal sender AsObject, ByVal e As DevExpress.XtraScheduler.AppointmentImagesEventArgs)
Dim info AsNew DevExpress.XtraScheduler.Drawing.AppointmentImageInfo()
info.Image = SystemIcons.Warning.ToBitmap()
e.ImageInfoList.Add(info)
EndSub