XlsIO provides portable class library for Xamarin platform. As the data table is not supported in portable platform, so XlsIO doesn’t support import data table into worksheet. However, you can convert the data table into an enumerable object and then import that object into worksheet using Worksheet.ImportData() method.
To know more about import data into worksheet, kindly refer the following documentation.
Documentation: https://help.syncfusion.com/file-formats/xlsio/working-with-data#import-data-from-business-objects
However this requirement can be achieved by an workaround. The sample can be downloaded from the following link
Sample link : http://www.syncfusion.com/downloads/support/directtrac/general/ze/XamarineSample1612899830.zip
Kindly refer the following code snippet for your reference
Code Snippet:
private IEnumerable<dynamic> GetDynamicData(DataTable table)
{
List<dynamic> dynamicData = new List<dynamic>(table.Rows.Count);
foreach (DataRow row in table.Rows)
{
ExpandoObject expando = new ExpandoObject();
foreach (DataColumn column in table.Columns)
{
(expando as IDictionary<string, object>).Add(column.ColumnName, row[column]);
}
dynamicData.Add(expando);
}
return dynamicData;
}
I work for Syncfusion.
Regards,
Abirami