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 :
Microsoft Dynamics AX (Archived)

Limiting the .csv file rows count

(0) ShareShare
ReportReport
Posted on by

Hello Everyone.

I want to write the table records into csv("export.csv") files.

Each csv file should has only 200 rows total and next 200 rows (201 to 400) should be written into a next csv("export2.csv") file.

-

I used this code to output the .csv file but this code writes all records in single .csv file.

  • fileExportCsv.writeExp(vatOutLine);

Please advice how to get the required result.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    I prefer to use System.IO.StreamWriter from .Net instead of AsciiIo and CommaIo, you could find examples using Google/Bing.

    After that, all you need to do is change your code to write the information per line, count how many did you write, then once you reach 200 in your counter, close the file and open a new one.

  • Mea_ Profile Picture
    60,286 on at

    Hi Htoo Ko Ko,

    writeExp accepts container so obviously you have code somewhere to populate this container with data. You can put 200 lines into container and call fileExportCsv.writeExp(vatOutLine); then put next and so on...

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans