We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ImportDataTable not available for XAMARIN android

Iam new to xamarin.I have created a Xamarin android project and added Syncfusion package using nuget. 
I have tried to implement the below code but Iam getting an error stating ImportDataTable is not available
ExcelEngine excelEngine = new ExcelEngine();

IApplication application = excelEngine.Excel;

application.DefaultVersion = ExcelVersion.Excel2013;

IWorkbook workbook = application.Workbooks.Create(1);

IWorksheet worksheet = workbook.Worksheets[0];

DataTable table = SampleDataTable();

//Import DataTable to the worksheet.

worksheet.ImportDataTable(table, true, 1, 1);

workbook.SaveAs("ImportFromDT.xlsx");

workbook.Close();

excelEngine.Dispose();
On further examination I see that only ImportData function is implemented and functions to implement imports of data table and lists are not implemented. I have added references to Syncfusion.XlsIO.Portable and Syncfusion.Compression.Portable. Is this because of any old version of Sync fusion libraries that Iam using. If so , how to download the latest one. (I can see from "Manage nuget package" space that Iam using the latest version of XLSIO.)




1 Reply

AV Abirami Varadharajan Syncfusion Team November 28, 2016 12:50 PM UTC

Hi Divya, 
 
Thank you for contacting Syncfusion support. 
 
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 UG documentation link for your reference.

UG documentation link: https://help.syncfusion.com/file-formats/xlsio/working-with-data#import-data-from-business-objects
 
 
Please let us know if you have any concern. 
 
Regards, 
Abirami. 


Loader.
Up arrow icon