Skip to main content

Posts

Showing posts from November, 2017

Read excel through X++ in D365FO

Sample code to read an excel file, all it need file stream as a parameter. public boolean importFromExcelfiles(System.IO. Stream _stream) {    OfficeOpenXml. ExcelWorksheet         worksheet;    OfficeOpenXml. ExcelRange             cells;    OfficeOpenXml. ExcelPackage           package = new OfficeOpenXml. ExcelPackage (_stream);             int totalRows,totalCells,rowCounter,cellCounter;     if (package)    {       worksheet       = package.get_Workbook().get_Worksheets().get_Item( 1 );       cells           = worksheet.Cells;       totalRows       = worksheet....