Hi
Theo,
Thanks
for using Syncfusion products.
We can draw the
chart control as bitmap image and add it to the sheet of excel file for your
requirements. Since, we don’t have built-in functionality to export the
multiple chart to excel. Kindly refer the below code snippet to achieve this,
[C#]
string
exportFileName = "Chart.xls";
//A new
workbook with a worksheet is created.
IWorkbook
chartBook = ExcelUtils.CreateWorkbook(1);
IWorksheet
sheet = chartBook.Worksheets[0];
int
toprow = 4, topcolumn = 5, bottomrow = 20, bottomcolumn = 12;
for
(int i = 0; i < 2; i++)
{
Bitmap
img = new Bitmap((int)chart[i].Width.Value, (int)chart[i].Height.Value);
chart[i].Draw(img);
string
chartimage = "chartimage" + i + ".Jpg";
sheet.Pictures.AddPicture(toprow, topcolumn, bottomrow, bottomcolumn,
img);
topcolumn = bottomcolumn + 3;
bottomcolumn = topcolumn + 7;
}
sheet.Activate();
//Save
the Chart book.
chartBook.SaveAs(Server.MapPath(exportFileName));
chartBook.Close();
ExcelUtils.Close();
Please refer the attached sample for this requirements and
let us know if any concerns.
Regards,
Vijayabharathi