Showing posts with label OpenXML. Show all posts
Showing posts with label OpenXML. Show all posts

Read Excel file using OpenXMLSDK Dynamics 365(AX-7)


Read Excel file using OpenXMLSDK Dynamics 365(AX-7)

Following is code you can use to read Excel using Open XML.






using DocumentFormat.OpenXml;
using System;
using System.Linq;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;

public class SLAX7_ImportClass
{

public void testRun()
{
OXMLSpreadsheetDocument_RU document = OXMLSpreadsheetDocument_RU::construct("C:\\AX\\Test.xlsx");
OXMLWorkBook_RU workbook = OXMLWorkBook_RU::construct(document);

OXMLWorksheet_RU worksheet = workbook.getWorksheet(1);

OXMLRow_RU row = worksheet.row(1);
OXMLCell_RU cell = Row.cell(1);
Global::info(strFmt('%1',cell.getValue()));

}

}

Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...