web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Exporting Vendor Master data using x ++ code

(0) ShareShare
ReportReport
Posted on by 3,124

Hi Experts,

There is any ready x++ code which can export all vendor data to excel sheet . 

Best Regards,

Shabir Ahmad

I have the same question (0)
  • Suggested answer
    mhdshb1 Profile Picture
    1,250 on at

    Hi Shabir,

    Do you really need to use x++ code to export ?

    You can use Data Import/Export Framework (DIXF) where you can export vendor data in a tabular format.

    Regards,

    M

  • Shabir Ahmad Profile Picture
    3,124 on at

    Hi Mohammad Al-Saheb,

    I wanted to use x++ job to export the vendor master data. I know DIXF is also good.

    Best Regards,

    Shabir Ahmad

  • Suggested answer
    mhdshb1 Profile Picture
    1,250 on at

    Hi Shabir, 

    Try this job it exports from VendTable.

    static void ExporttoExcel(Args _args)
    {
        SysExcelApplication              sysExcelApplication;
        SysExcelWorkbooks              excelWorkbookCollection;
        SysExcelWorkbook               excelWorkbook;
        SysExcelWorksheets             excelWorksheetCollection;
        SysExcelWorksheet              excelWorksheet;
        int                                          i =1;
        str                                          filename;
        vendTable                             vendTable;
        ;
    
    
        // give the file name and save it to c drive
         filename = "c:\\test.xls";
    
        // initlize the SysExcelApplication instance
        sysExcelApplication  = SysExcelApplication::construct();
    
        //create excel workbook and excel worksheet
        excelWorkbookCollection  = sysExcelApplication.workbooks();
        excelWorkbook    = excelWorkbookCollection.add();
        excelWorksheetCollection = excelWorkbook.worksheets();
        excelWorksheet = excelWorksheetCollection.itemFromNum(1);
    
        // excel column captions
    
        excelWorksheet.cells().item(i,1).value("AccountNumber");
        excelWorksheet.cells().item(i,2).value("AccountName");
        excelWorksheet.cells().item(i,3).value("VendorGroup");
        i  ;
        // fill the excel with vendtable Fields
        while select VendTable
        {
           excelWorksheet.cells().item(i,1).value(vendTable.AccountNum);
            excelWorksheet.cells().item(i,2).value(vendTable.name());
            excelWorksheet.cells().item(i,3).value(vendTable.VendGroup);
            i  ;
        }
    
        //check the fileName is already exist
         if(WinAPI::fileExists(filename))
             WinAPI::deleteFile(filename);
         // save excel file
         excelWorkbook.saveAs(filename);
    
        // open excel file
        sysExcelApplication.visible(true);
    
        // close excel file
     // sysExcelApplication.quit();
    
    }

    Hope this helps,

    Regards,

    M

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi Shabir,

    You can use the SysExcel* class to export, try some published blog codes.

    Please refer this: imdaxershiv.blogspot.com/.../x-code-to-export-data-to-excel-sheet-in.html

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 694

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 646 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 337

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans