Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

How to download the CSVBuffer data in Business Central

Posted on by 5

Hi,

I'm trying to download a CSV file (Created with CSV Buffer)

Using procedure: 

TempCSVBuffer.SaveData();
But it has an On-prem scope.
and I also want to change the separator from " , " to " ; "

pastedimage1680170933755v1.png

Can anyone help with resolving this problem?

  • Abdullah Javed Profile Picture
    Abdullah Javed 5 on at
    RE: How to download the CSVBuffer data in Business Central

    Thanks, Hasnain Ali. it's working.

  • Verified answer
    Hasnain Ali Profile Picture
    Hasnain Ali 132 on at
    RE: How to download the CSVBuffer data in Business Central

    Hi Abdullah,

    You will have to use SaveDataToBlob procedure and DownloadStream to download it.
    For this, convert csv to InStream. You can use Temp Blob.

    Example:

    TempCSVBuffer.SaveDataToBlob(TempBlob, ';');

    ';' is the seperator here.

    TempBlob.CreateInStream(InStream, TEXTENCODING::UTF8);

    DownloadFromStream(InStream, '', '', '', 'Your file name here with extension');

    Hope this will work 

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: How to download the CSVBuffer data in Business Central

    Here is also some additional info about handling files though a stream.

    learn.microsoft.com/.../file-downloadfromstream-method

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: How to download the CSVBuffer data in Business Central

    You have to go through a stream to download the content,

    Erik has made a great video about this that can be good to watch.

    www.youtube.com/watch

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,134 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,928 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans