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

ExportToICalendar (Q2 2014) Description not showing in Outlook 2012

5 Answers 26 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 06 Oct 2014, 04:27 PM
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!

5 Answers, 1 is accepted

Sort by
0
Randy
Top achievements
Rank 1
answered on 06 Oct 2014, 04:47 PM
Correction: The client is Outlook 2013
0
Boyan Dimitrov
Telerik team
answered on 09 Oct 2014, 12:38 PM
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.

 
0
Randy
Top achievements
Rank 1
answered on 09 Oct 2014, 02:11 PM
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;
}
0
Randy
Top achievements
Rank 1
answered on 09 Oct 2014, 09:07 PM
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;
}
0
Boyan Dimitrov
Telerik team
answered on 14 Oct 2014, 12:08 PM
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.

 
Tags
Scheduler
Asked by
Randy
Top achievements
Rank 1
Answers by
Randy
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or