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

Export example not working with Advanced Form?

4 Answers 61 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kevin Price
Top achievements
Rank 1
Kevin Price asked on 19 Mar 2010, 09:10 PM
I have created a scheduler and associated advanced form based on the examples and that is working nicely. I went back in to add the export functions and based on the sample...
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
 
        <script type="text/javascript"
            function Export(sender, e) { 
                $find("<%= RadAjaxManager1.ClientID %>").__doPostBack(sender.name, ""); 
            } 
        </script> 
 
    </telerik:RadCodeBlock> 
The page posts back, but nothing happens??

 <AppointmentTemplate>
                <%--<div style="color: #ffffff; font-size: medium;">--%>
                <strong style="color: #ffffff">Title:
                    <%#Eval("Subject") %>
                    <br />
                    Type:
                    <%# Eval ("reservation_type") %>
                    <br />
                    Resource:
                    <%--<asp:Label ID="lblResourceTitle" runat="server"></asp:Label>--%>
                </strong>
                <%-- </div>--%>
                <div style="text-align: right;">
                    <asp:Button runat="server" ID="Button1" CssClass="rsExportButton" ToolTip="Export to iCalendar"
                        CommandName="Export" OnClientClick="Export(this, event); return false;" Style="cursor: pointer;
                        cursor: hand;" />
                </div>
            </AppointmentTemplate>

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Mar 2010, 01:55 PM
Hi Kevin,

Please, make sure you have included the code-behind part of the iCalendar Export demo in your page: 

protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
       {
           if (e.CommandName == "Export")
           {
               WriteCalendar(RadScheduler.ExportToICalendar(e.Container.Appointment));
           }
       }
       protected void Button2_Click(object sender, ImageClickEventArgs e)
       {
           WriteCalendar(RadScheduler.ExportToICalendar(RadScheduler1.Appointments));
       }
       private void WriteCalendar(string data)
       {
           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(data);
           response.End();
       }

Let me know how it goes.


Regards,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Kevin Price
Top achievements
Rank 1
answered on 23 Mar 2010, 04:01 PM
Peter,
You're going to laugh, but the whole problem with this was the in the properties for the Scheduler. In a rush, I had cut/pasted OnAppointmentCreated and forgot to change it to OnAppointmentCommand in the RadScheduler tag. Obviously, I needed the weekend.

Thanks,
Kevin
0
Kevin Price
Top achievements
Rank 1
answered on 23 Mar 2010, 05:54 PM
Got this working with the exception of the following error:
Sys.WebForms.PageRequestManagerParserErrorException:
The message received from the server could not be parsed. Common causes for this error are whe the response is modified by calls to Response.Write(), response filters, HttpModules,or server trace is enabled.
Details: Error parsing near 'BEGIN:VCALENDAR
VER'.

But the exports do import to Outlook fine.
0
T. Tsonev
Telerik team
answered on 26 Mar 2010, 01:50 PM
Hi Kevin,

I'm attaching the sample project (Advanced form + Export) sent from your support ticket here for community reference.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Kevin Price
Top achievements
Rank 1
Answers by
Peter
Telerik team
Kevin Price
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or