24 Jul’17

D365 Business CentralExporting record details to excel using Excel Buffer in Microsoft Dynamics NAV 2017


In this article, the selected record details by the user are exported to excel using Excel Buffer.

The requirement was such that Purchase Request is sent to the Vendors to enter the Unit cost of each Purchase Items. These details are sent to the vendors in an excel sheet. After the Unit cost is entered the excel sheet is imported again in the Dynamics NAV.


Microsoft Dynamics NAV 2017


1.Create a report and Data link between the records.

2. Below is the screenshot of the Data Item Link

3. In the globals (Ctrl+G), define the excel buffer table (no 370) to create excel sheet

4. Define the function MakeExcelDataHeader to create the header of the excel sheet and MakeExcelDataBody for the Body Lines.

5. Create a Boolean variable Print to Excel and insert it in the request page. If true then call the function CreateExcelBook.

6. On the PreDataItem Call the function MakeDataExcelHeader and OnAfterGetRecords call the function MakeDataBody

7. Using Excel Buffer table code as below in the functions

8. In the Page, create an action button to run the report.

9. In the page, select the record and click on the Export to Excel button

10. Click on OK

11. This call the report and fetches the data records in an excel sheet. This sheet is then sent to the vendor to enter the unit cost of the respective item.


Thus using excel buffer record we can export records from Microsoft Dynamics NAV to Excel sheets.


Written by

Chris D'Silva

Software Developer

2 thoughts on “Exporting record details to excel using Excel Buffer in Microsoft Dynamics NAV 2017”

    1. Hi,

      We have mentioned each step in this blog article. Please let us know if you are facing issue while implementing any particular step or if you are unable to get any step.

      Please let us know, and we will be happy to assist you.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more