You need to modify the event handler as follows:
protected void DayPilotScheduler1_BeforeResHeaderRender(object sender, BeforeResHeaderRenderEventArgs e)
{
DataItemWrapper task = e.DataItem;
int duration = Convert.ToInt32(task["Days"]);
if (DayPilotScheduler1.IsExport) {
e.Columns[0].InnerHTML = duration + " 天";
}
else {
e.Columns[0].InnerHTML = <div style='text-align:right; padding: 0px 6px 0px 2px;'>" + duration + " 天</div>";
}
}
See also:
http://kb.daypilot.org/86539/events-show-html-source-during-image-export-png/