This is a migrated thread and some comments may be shown as answers.

[Solved] Icalendar to Outlook for SelectedView

3 Answers 117 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
nagi
Top achievements
Rank 1
nagi asked on 31 Dec 2007, 05:25 AM
Hi ,
Its great work is dont by Telerik in exporting to the calendar . when i click on the export button(samples version ) its exporting all the events on the scheduler . I want to export appointments based on the SelectedView . For Ex, if scheduler is in MonthView only  the month appointments should be exported. Please give me some suggestions

Thanks in advance
Nagireddy T

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 03 Jan 2008, 01:34 PM
Hi Nagi,

Thank you for your question. While searching for a solution, we discovered a limitation of RadScheduler which prevents an easy implementation for this scenario. 

The good news is that there is a workaround you can try. Please, consider the iCalendar Export online example. The content of the iCalendar file has the following format for its content when viewed in a text editor:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Telerik Inc.//NONSGML RadScheduler//EN
METHOD:PUBLISH

BEGIN:VEVENT
DTSTART:20070330T063000Z
DTEND:20070330T073000Z
RRULE:FREQ=DAILY;UNTIL=20070406T073000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR
UID:20080103T132558Z-15
DTSTAMP:20080103T132558Z
SUMMARY:Technical meeting
END:VEVENT
*   *    *    *    *
BEGIN:VEVENT
DTSTART:20070329T210000Z
DTEND:20070330T210000Z
UID:20080103T132558Z-27
DTSTAMP:20080103T132558Z
SUMMARY:Alex's Birthday
END:VEVENT

END:VCALENDAR

The challenge is to create a string with similar formatting based on the appointments in the visible range of RadScheduler and pass it to the WriteCalendar() method. We came up with the following solution -

Button2_Click event handler:

protected void Button2_Click(object sender, ImageClickEventArgs e)  
        {  
            //WriteCalendar(RadScheduler.ExportToICalendar(RadScheduler1.Appointments));  
 
            StringBuilder visibleAppointments = new StringBuilder();  
            foreach (Appointment a in RadScheduler1.Appointments.GetAppointmentsInRange(RadScheduler1.VisibleRangeStart, RadScheduler1.VisibleRangeEnd))  
            {  
                string appointmentDetails = RadScheduler.ExportToICalendar(a);  
                                  
                string appointmentDetailsTrimmed = appointmentDetails.Replace("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Telerik Inc.//NONSGML RadScheduler//EN\r\nMETHOD:PUBLISH\r\n""");  
                appointmentDetailsTrimmed = appointmentDetailsTrimmed.Replace("\r\nEND:VCALENDAR""");  
                visibleAppointments.Append(appointmentDetailsTrimmed);  
            }  
 
            visibleAppointments.Insert(0, "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Telerik Inc.//NONSGML RadScheduler//EN\r\nMETHOD:PUBLISH\r\n");  
            visibleAppointments.Append("END:VCALENDAR");  
            WriteCalendar(visibleAppointments.ToString());  
        } 


Feel free to contact us if you have any questions.


Greetings,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
nagi
Top achievements
Rank 1
answered on 04 Jan 2008, 12:15 PM
thanks for the reply peter ..
0
pucsoftware
Top achievements
Rank 1
answered on 17 Sep 2009, 09:01 PM
This is helpful. Thanks, but sure would like an easier way to populate more properties using the appointment item directly.
Tags
Scheduler
Asked by
nagi
Top achievements
Rank 1
Answers by
Peter
Telerik team
nagi
Top achievements
Rank 1
pucsoftware
Top achievements
Rank 1
Share this question
or