Hi Johnes,
Your requirement of "Exporting multiple datagrid
in a single excel file" can be mentioning the worksheet number while
calling the ExportToExcel method. We prepared a sample and attached with this
response for your reference.
Kindly refer the below code snippet
|
var options = new ExcelExportingOptions();
options.ExcelVersion = ExcelVersion.Excel2013;
ExcelEngine excelEngine = new ExcelEngine();
IWorkbook workBook =
excelEngine.Excel.Workbooks.Create();
dataGrid.ExportToExcel(dataGrid.View,
options, workBook.Worksheets[0]);
dataGrid1.ExportToExcel(dataGrid1.View,
options, workBook.Worksheets[1]);
workBook.SaveAs("Sample.xlsx");
|
You can also
refer our online user guide documentation regarding the same by the following
link and also we have attached the sample for your reference.
UG link: https://help.syncfusion.com/wpf/datagrid/export-to-excel#worksheet-customization
We hope this
helps. Please let us know, if need any further assistance.
Regards,
Chidanand M.
Attachment:
SfDataGrid_Demo4_8_bf3ce7a9.zip