Tuesday 4 January 2022

How to export data using excel buffer in Business Central Sandbox for all the available companies

Hello guys, 

Happy new year to everyone, so in this blog I'm going to discuss about exporting data using excel buffer for all the available companies.

questions that would arise is answered below-

Why we need excel buffer to export when we have built-in excel which exports record?

We use excel buffer in Business central only when we need to handle a special situations like, 

to export all the data from all the available companies, 

export data for different languages ex. french, german or arabic or any other.


So, long story short I'll let you know what I did to export G/L Account in sandbox.

Create  a codeunit and a page. Page for a button click and codeunit to do your export processing.

Step 1: Create a new codeunit with a procedure to do your excel export for all the companies.

We need a temp excel buffer to store the data,

Use NewRow to create new rows in excel.

use addcolumn function to add new columns, do the data assignments and create a new excel write into sheet and close the book. 

The below code can be used to perform your actions.


Step 3: Create a new page with an action button which points to the procedure of your newly created codeunit.


Step 4: Publish the extension and verify the exported records.


2 comments:

  1. CreditQ is one of the best credit information bureau, responsible for managing the credit related activities of companies and individuals.

    ReplyDelete
  2. I particularly enjoyed your recent post. The way you explained this blog, really resonated with me and provided a fresh perspective on the matter.

    Dynamics Business Central In Uae

    ReplyDelete