Langsung ke konten utama

Postingan

Menampilkan postingan dengan label convert to excel

Create an Excel File using X++

Create an Excel File using X++ Creating an excel file is essential mostly in data import or export. Microsoft Dynamics AX has a feature to import and export through excel template. But in some cases, you need to create an excel to integrate with other application. Below is an example of creating an excel file in X++ using an existing table in AX. static void ExportToExcel(Args _args) { #AviFiles SysOperationProgress progress = new SysOperationProgress(); SysExcelApplication sysExcelApplication; SysExcelWorkbooks sysExcelWorkBooks; // Filename to which you will be writing your data FileName fileName = "C:\\Windows\\Temp\\ExportToExcel.xlsx"; SysExcelWorkbook sysExcelWorkBook; SysExcelWorkSheets sysExcelWorkSheets; SysExcelWorkSheet sysExcelWorkSheet; SysExcelWorkSheet sysExcelWorksheetBackOrder; SysExcelWorksheet sysExcelWorkSheetToBeDeleted; SysExcelStyles ...

Example export data to excel in AX 2012

Example export data to excel in AX 2012 void exportToExcel() {     SysExcelApplication application;     SysExcelWorkBooks workbooks;     SysExcelWorkBook workbook;     SysExcelWorksheets worksheets;     sysExcelWorksheet worksheet;     SysExcelCells cells;     SysExcelCell cell;     int row;     ;     application = SysExcelApplication::construct();     workbooks = application.workbooks();     //gets the workbook object     workbook = workbooks.add();     // creates a new workbook     worksheets = workbook.worksheets();     //gets the worksheets object     worksheet = worksheets.itemFromNum(1);     //Selects the first worksheet in the workbook to insert data     cells = worksheet.cells();     cells.range('A:A').numberFormat('@'); // numberFormat ‘@’ is to insert data ...