Search
Exporting

Currently MindFusion.Scheduling supports exporting to image, XLSX, and PDF formats.

Exporting to image

To export a Calendar as an image, call one of the CreateImage overloads. These methods allow exporting the entire control or only the currently visible portion of it. All methods return an instance of the Bitmap class, which contains the exported image. This image needs to be subsequently saved to a file or a stream.

The following example illustrates how to export the currently visible area of calendar to an image file identified by the imagePath variable.

C#  Copy Code

using (Image image = calendar.CreateImage(true))
    image.Save(imagePath);

VB.NET  Copy Code

Using image As Image = calendar.CreateImage(True)
    image.Save(imagePath)
End Using

Exporting to Open Office XML (XLSX) files

Add references to the MindFusion.Scheduling.Excel.dll and MindFusion.Excel.dll assemblies to your project. Create an ExcelExporter instance and call its Export method, passing a reference to the calendar to be exported and a string specifying the output file name.

The following example shows how to export a calendar to an XLSX file. The example assumes that xlsxPath is a variable containing the name of the file to export to and calendar is a variable identifying the Calendar to export.

C#  Copy Code

MindFusion.Scheduling.Export.ExcelExporter excelExporter =
    new MindFusion.Scheduling.Export.ExcelExporter();
excelExporter.Export(calendar, xlsxPath);

VB.NET  Copy Code

Dim excelExporter As New MindFusion.Scheduling.Export.ExcelExporter()
excelExporter.Export(calendar, xlsxPath)

Exporting to PDF files

Add references to the MindFusion.Scheduling.Pdf.dll and MindFusion.Pdf.dll assemblies to your project. Create a PdfExporter instance and call its Export method, passing a reference to the calendar to be exported and a string specifying the output file name.

The following example shows how to export a calendar to a PDF file. The example assumes that pdfPath is a variable containing the name of the file to export to and calendar is a variable identifying the Calendar to export.

C#  Copy Code

MindFusion.Scheduling.Export.PdfExporter pdfExporter =
    new MindFusion.Scheduling.Export.PdfExporter();
pdfExporter.Export(calendar, pdfPath);

VB.NET  Copy Code

Dim pdfExporter As New MindFusion.Scheduling.Export.PdfExporter()
pdfExporter.Export(calendar, pdfPath)