Skip to main content
A newer version of this page is available. .

Export and Import

  • 2 minutes to read

You can import/export the Scheduler control’s appointments in the iCalendar format. This format is used to transfer data between calendar and scheduling applications, including Apple iCal, Google Calendar, Microsoft Exchange Server, Microsoft Office Outlook, Novell GroupWise, and Windows Calendar.

This document consists of the following sections.

Export

The iCalendarExporter class allows you to export appointments. Follow the steps below to export scheduler appointments to the iCalendar format.

  1. Create an iCalendarExporter class instance in code.

    iCalendarExporter exporter = new iCalendarExporter(Scheduler.Storage);
    
  2. Create a stream and pass it to the AppointmentExporter.Export method.

    using(MemoryStream memoryStream = new MemoryStream()) {
        exporter.Export(memoryStream);
        ...
    }
    
  3. The stream now contains appointment data in the iCalendar format. You can save the stream’s content on server or pass this content to the client by writing it to the HTTP output.

    Stream outputStream = Response.OutputStream;
    memoryStream.WriteTo(outputStream);
    outputStream.Flush();
    

Import

The iCalendarImporter class allows you to import appointments. Use the following steps to import scheduler appointments from the iCalendar format:

  1. Create an instance of the iCalendarImporter class in code.

    iCalendarImporter importer = new iCalendarImporter(Scheduler.Storage);
    
  2. Pass a stream with iCalendar data to the AppointmentImporter.Import method to load data to the Scheduler.

    importer.Import(stream);
    
See Also