ExportToICalendar (Q2 2014) Description not showing in Outlook 2012

6 posts, 0 answers
  1. Randy
    Randy avatar
    26 posts
    Member since:
    Jul 2013

    Posted 06 Oct 2014 Link to this post

    This was working in our Events Management system for until recently.
    We recently migrated everyone to Outlook 2012.
    I updated my VS 2012 project this morning to Q2 2014 .NET 3.5.

    Now Appointment.Description is not coming across in the ics appointment in Outlook.

    Has anyone else experienced this?
    Is there a work around?

    Thanks!
  2. Randy
    Randy avatar
    26 posts
    Member since:
    Jul 2013

    Posted 06 Oct 2014 in reply to Randy Link to this post

    Correction: The client is Outlook 2013
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 09 Oct 2014 Link to this post

    Hello,

    I tried to export a single appointment ( please use our Export to ICal demo)  with description and open in the outlook 2013. At my side it shows the description text in appointment content below the start and end times as shown in the attached screenshot.

    Regards,
    Boyan Dimitrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Randy
    Randy avatar
    26 posts
    Member since:
    Jul 2013

    Posted 09 Oct 2014 in reply to Boyan Dimitrov Link to this post

    I am using your code - except that I'm getting the appointment data from the database and populating a new Appointment object, then using ExportToICalendar to generate the ics file. It was working before.

    I am trying to determine which of the two events broke it.

    1) Enterprise update to Exchange/Outlook 2013
    2) Updating the project to Q2 2014

    I will continue to research the Exchange/Outlook side.

    Here's my code in case you can spot an obvious problem:

    protected void btnAddTimeslotToOutlook_Click(object sender, CommandEventArgs e)
    {
        int attendeeid;
        if (Int32.TryParse(e.CommandArgument.ToString(), out attendeeid))
        {
            using (DataSet ds = Attendees.AttendeeDetails(attendeeid))
            {
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        object id = ds.Tables[0].Rows[0]["EventID"].ToString();
                        string subject = ds.Tables[0].Rows[0]["EventName"].ToString();
                        string description = DataCleanup.StripHtml(ds.Tables[0].Rows[0]["Description"].ToString());
                        string location = ds.Tables[0].Rows[0]["Location"].ToString();
                        DateTime startdatetime = DateTime.Parse(ds.Tables[0].Rows[0]["TimeSlotStartTime"].ToString());
                        DateTime enddatetime = DateTime.Parse(ds.Tables[0].Rows[0]["TimeSlotEndTime"].ToString());
                        string timeslotinfo = string.Empty;
                        string apptdescription = string.Empty;
     
                        Appointment appointment = new Appointment();
                        appointment.ID = id;
                        appointment.Subject = subject;
                        appointment.Description = "Where: " + location + Environment.NewLine + Environment.NewLine + "What: " + description;
                        appointment.Start = startdatetime;
                        appointment.End = enddatetime;
     
                        HttpResponse response = Page.Response;
                        response.Clear();
                        response.Buffer = true;
                        response.ContentType = "text/calendar";
                        response.ContentEncoding = Encoding.UTF8;
                        response.Charset = "utf-8";
                        response.AddHeader("Content-Disposition", "attachment;filename=\"RadSchedulerExport.ics\"");
                        response.Write(ParseForExport(appointment, location));
                        response.End();
                    }
                }
            }
        }
    }
     
     
    protected static string ParseForExport(Appointment appt, string eventLocation)
    {
        string _apptdata = RadScheduler.ExportToICalendar(appt);
        string _extraData = string.Empty;
        if (!string.IsNullOrEmpty(eventLocation))
        {
            _extraData += "LOCATION:" + eventLocation + "\r\n";
        }
        if (_extraData.Length > 0)
        {
            _apptdata = _apptdata.Replace("BEGIN:VEVENT\r\n", "BEGIN:VEVENT\r\n" + _extraData);
        }
        return _apptdata;
    }
  6. Randy
    Randy avatar
    26 posts
    Member since:
    Jul 2013

    Posted 09 Oct 2014 Link to this post

    Outlook 2013 or Exchange (not sure which) is ignoring the Description property in the ics file.

    I resolved the issue by parsing the description from the database and using it to add the "X-ALT-DESC" property.
    I had already created a method to process and add the "Location" property.

    Parser method below:

    protected static string ParseForExport(Appointment _appt, string _location, string _description)
    {
        string _apptdata = RadScheduler.ExportToICalendar(_appt);
        string _locationdefinition = "LOCATION:{0}\r\n";
        string _altdescriptiondefinition = "X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML>\\n<HTML>\\n<HEAD>\\n<TITLE></TITLE>\\n</HEAD>\\n<BODY>\\n<SPAN LANG='en-us'><FONT FACE='Calibri'>{0}</FONT></SPAN>\\n</BODY>\\n</HTML>\r\n";
        string _extradata = string.Empty;
        if (!string.IsNullOrEmpty(_location))
        {
            _extradata += string.Format(_locationdefinition, _location);
        }
        if (!string.IsNullOrEmpty(_description))
        {
            _extradata += string.Format(_altdescriptiondefinition, _description);
        }
        if (_extradata.Length > 0)
        {
            _apptdata = _apptdata.Replace("BEGIN:VEVENT\r\n", "BEGIN:VEVENT\r\n" + _extradata);
        }
        return _apptdata;
    }
  7. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 14 Oct 2014 Link to this post

    Hello,

    Thank you for sharing this information with the community.


    Regards,
    Boyan Dimitrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017