Problem
The exported image (PNG, GIF, JPG) shows HTML source instead of formatted text. This can happen at the following places:
Explanation
HTML rendering is not supported during image export.
Workaround
Use the Before*Render events to supply plain text instead of the HTML. The export can be detected by checking IsExport property.
Example 1 (Calendar events)
protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e) { if (DayPilotCalendar1.IsExport) { e.InnerHTML = e.Text; } else { e.InnerHTML = String.Format("<span style='color:green'>{0}</span>", e.Text); } }
Example 2 (Scheduler upper-left corner)
protected void DayPilotScheduler1_BeforeResHeaderRender(object sender, DayPilot.Web.Ui.Events.BeforeHeaderRenderEventArgs e) { if (e.IsCorner) { if (DayPilotScheduler1.IsExport) { e.InnerHTML = DayPilotScheduler1.StartDate.Year.ToString(); } else { e.InnerHTML = String.Format("<div style="padding: 5px; font-weight: bold; font-size: 22px; text-align: center;">{0}</div>", DayPilotScheduler1.StartDate.Year); } } }