How to: Modify the Print Style and Hide the Mini-calendar from the Page Header

  • 2 minutes to read

When printing the scheduler via the SchedulerControl.Print method, you can save space, and print the scheduled time interval in greater detail, if the mini-calendar at the top of the page and extra lines with information about appointments which are outside the specified time interval are removed from the printout. You can also restrict the number of printed resources. The following code snippet demonstrates how to accomplish this.

using DevExpress.XtraScheduler.Printing;
// ...
DailyPrintStyle style =
schedulerControl1.PrintStyles[SchedulerPrintStyleKind.Daily] as DailyPrintStyle;

// Do not print mini-calendar at the top of the page.
style.CalendarHeaderVisible = false;
// Do not print appointment details for appointments outside the specified interval.
style.PrintAllAppointments = false;
// Specify the time interval to print.
style.PrintTime = new TimeOfDayInterval(new TimeSpan(11, 0, 0), new TimeSpan(15, 0, 0));
// Specify resources to print.
style.ResourceOptions.PrintAllResourcesOnOnePage = false;
style.ResourceOptions.ResourcesPerPage = 2;
style.ResourceOptions.PrintCustomCollection = true;
style.ResourceOptions.CustomResourcesCollection.Add(schedulerControl1.Storage.Resources[0]);
style.ResourceOptions.CustomResourcesCollection.Add(schedulerControl1.Storage.Resources[1]);

schedulerControl1.ShowPrintPreview(style);

The print preview window is shown in the picture below.

Print Styles - Header Calendar