Skip to main content

How to: Modify Date Formatting of Headers in the XtraScheduler Report

  • 2 minutes to read

This document illustrates how the Scheduler services can be used in Scheduler Reporting to modify captions of the view elements. In other words, the default HeaderCaptionService is substituted to change the date formatting used by the HorizontalDateHeaders in the daily style report.


You can handle the HorizontalDateHeaders.CustomDrawDayHeader event to accomplish manual painting of the header.

using DevExpress.XtraScheduler.Reporting;
using DevExpress.XtraScheduler.Services;
using DevExpress.XtraScheduler.Drawing;
using DevExpress.XtraScheduler.Services.Implementation;
// ...
    string dateFormat = "dd-MMM, ddd";
    SchedulerStoragePrintAdapter storagePrintAdapter = 
        XtraSchedulerReport1.SchedulerAdapter as SchedulerStoragePrintAdapter;
    if (storagePrintAdapter != null) {
        IHeaderCaptionService customHeaderCaptionService = 
            new CustomHeaderCaptionService(dateFormat);

public class CustomHeaderCaptionService : HeaderCaptionServiceWrapper {
    string format;
    public CustomHeaderCaptionService(string format)
        : base(new HeaderCaptionService()) {
        this.format = format;
    protected virtual string CreateFormat(string format) {
        if(format == "Default")
            return string.Empty;
        return String.Format("{{0:{0}}}", format);
    public override string GetDayColumnHeaderCaption(DayHeader header) {
        return CreateFormat(format);
See Also