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

Export to ICalendar formatting problem

5 Answers 97 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Goksun
Top achievements
Rank 1
Goksun asked on 28 Jul 2008, 09:52 PM
Hello,

I've been having a little formatting problem with exporting the appointments to Outlook. What I am trying to do is get some custom attributes of the appointment and insert them in the Description field. What I want is something like this

Description of the event
Contact Person: bla bla
Contact Email: bla@bla.com
Event Link: http://www.bla.com

I wasn't able to insert new line characters in between. If I don't insert anything, all above info appears in one line (which I don't want). I've tried the solution from another forum post by replacing "\n" and "\r\n" with "\\n" but that didn't work either. I am sure there's a very simple solution to this but I wasn't able to find it.

Thanks
Goksun

5 Answers, 1 is accepted

Sort by
0
Goksun
Top achievements
Rank 1
answered on 30 Jul 2008, 05:49 PM
Hello again, so does anyone have a solution for this? Even a different approach is fine. I am stuck.

Thanks
Goksun
0
Goksun
Top achievements
Rank 1
answered on 30 Jul 2008, 10:05 PM
I've figured it out. You just need to insert "=0d=0a" for CR and LF chars. It works.

0
Clyde
Top achievements
Rank 1
answered on 11 Sep 2008, 01:01 AM
Hi Goksun,

Any chance you can share some of the code you use to update the description field for an iCalendar export. Or anyone else that could please point me in the right direction. I've not had much success with the help.

My iCalendar export is working fine for Subject field and all the appointment time data. I would like to populate the Location and Description fields within Outlook. Any idea how to add that to the appointment class so that it can be exported along with the iCalendar file?

Thanks
Clyde
0
Fournier
Top achievements
Rank 1
answered on 20 Feb 2009, 02:47 PM
Hi Clyde,

I've no idea if you solve your problem. I suggest you to take a look at the corresponding RFC : RFC 2445.

I also give you my code to create en export to icalendar. First take a look at the documentation, and then change this part of code :
 WriteCalendar(RadScheduler.ExportToICalendar(e.Container.Appointment)); 

into

            string data = ""
            data = "BEGIN:VCALENDAR\r\n"
            data  += "VERSION:2.0\r\n"
            data += "PRODID:-//Telerik Inc.//NONSGML RadScheduler//EN\r\n"
            data += "METHOD:PUBLISH\r\n"
            foreach (Appointment appt in Rs_Agenda.Appointments) 
            { 
                data += "BEGIN:VEVENT\r\n"
                data += "DTSTART:" + appt.Start.Year + "" + appt.Start.Month.ToString("D2") + "" + appt.Start.Day.ToString("D2") + "T" + appt.Start.Hour.ToString("D2") + "" + appt.Start.Minute.ToString("D2") + "" + appt.Start.Second.ToString("D2") + "Z\r\n"
                data += "DTEND:" + appt.End.Year + "" + appt.End.Month.ToString("D2") + "" + appt.End.Day.ToString("D2") + "T" + appt.End.Hour.ToString("D2") + "" + appt.End.Minute.ToString("D2") + "" + appt.End.Second.ToString("D2") + "Z\r\n"
                data += "UID: " + appt.ID + "\r\n"
                data += "DTSTAMP:" + appt.Start.Year + "" + appt.Start.Month.ToString("D2") + "" + appt.Start.Day.ToString("D2") + "T" + appt.Start.Hour.ToString("D2") + "" + appt.Start.Minute.ToString("D2") + "" + appt.Start.Second.ToString("D2") + "Z\r\n"
                data += "SUMMARY:" + appt.Subject; 
                data += "\r\n"
                data += "END:VEVENT\r\n"
            } 
            data += "END:VCALENDAR\r\n"
 
            WriteCalendar(data); 


Hope this help.

C├ędric


0
Clyde
Top achievements
Rank 1
answered on 20 Feb 2009, 02:55 PM
Thanks Cedric,

I haven't yet, this is very much appreciated. Hopefully I can return the favour one day.

Regards
Clyde

Tags
Scheduler
Asked by
Goksun
Top achievements
Rank 1
Answers by
Goksun
Top achievements
Rank 1
Clyde
Top achievements
Rank 1
Fournier
Top achievements
Rank 1
Share this question
or