Image Export (BMP, PNG, GIF, JPG)

It is possible to export the Scheduler into several image formats:
Usage
Call DayPilotScheduler.Export() method:
MemoryStream img = DayPilotScheduler1.Export(ImageFormat.Png);
Applications
- Print the exported image reliably.
- Save the exported image to a file.
- Non-web applications:
- Show a read-only calendar in WebForm applications
- Include a Scheduler snapshot in PDF files generated on the server
- Include a Scheduler snapshot in generated e-mails
Limitations
Some limitations apply:
- The related CSS classes are ignored (CssClassPrefix)
- It's not possible to use HTML in Before*Render events. You can detect the export by checking DayPilotScheduler.IsExport property and set e.InnerHTML to plain text during export.
Example
This example returns the current Scheduler view as PNG image (it forces the Open/Download dialog box by setting "content-disposition" HTTP header).
protected void ButtonExport_Click(object sender, EventArgs e)
{
setDataSourceAndBind();
Response.Clear();
Response.ContentType = "image/png";
Response.AddHeader("content-disposition", "attachment;filename=print.png");
MemoryStream img = DayPilotScheduler1.Export(ImageFormat.Png);
img.WriteTo(Response.OutputStream);
Response.End();
}
Available Since