1

I have read the article to Export (.ical) Individual Events from SharePoint Calendar

So I have found this URL

http://yoursite/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List=%3CLISTGUID%3E&CacheControl=1&ID=%3CITEMID%3E&Using=event.ics

using this I'm able to export individual event in to ICS format.

Now I'm trying to export all the event using single URL.

Is it possible to export?

Give me some suggestions.

3

For what I have experienced, this isn't directly possible. There's a suggested programmatical approach to this problem which should export all of the calendar's events in an ICS format:

StringBuilder sw = new StringBuilder();
    sw.AppendLine("BEGIN:VCALENDAR");
    sw.AppendLine("VERSION:2.0");
    sw.AppendLine("METHOD:PUBLISH");
    foreach (var item in items)
    {
        sw.AppendLine("BEGIN:VEVENT");
        sw.AppendLine("CLASS:PUBLIC");
        sw.AppendLine(string.Format("CREATED:{0:yyyyMMddTHHmmss}", DateTime.UtcNow));
        sw.AppendLine("DESCRIPTION: " + Convert.Tostring(item["Description"]));
        sw.AppendLine(string.Format("DTEND:{0:yyyyMMddTHHmmss}", Convert.ToDateTime(item[EndDate]));
        sw.AppendLine(string.Format("DTSTART:{0:yyyyMMddTHHmmss}", Convert.ToDateTime(item[StartDate]));
        sw.AppendLine("SEQUENCE:0");
        sw.AppendLine("UID:" + Guid.NewGuid().ToString());
        sw.AppendLine("LOCATION:" + Convert.ToString(item["Location"]));
        sw.AppendLine("SUMMARY;LANGUAGE=en-us:" + Convert.ToString(item["Title"]));
        sw.AppendLine("END:VEVENT");
    }
    sw.AppendLine("END:VCALENDAR");

Page.Response.Clear();
Page.Response.ContentType = "text/calendar";
Page.Response.AddHeader("content-disposition", "inline; filename=" + "Test.ics");
Page.Response.Write(sw.ToString());
Page.Response.Flush();

Another way to go, which would still include an event-by-event exporting, would be to create a calculated column for your calendar which creates a link to download the ICS-file for the event. This solution requires the use of Text to HTML javaScript-library. That way the event's exporting should be faster and accessible for all users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.