web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Mea_ Profile Picture
    60,284 on at
    RE: Limiting the .csv file rows count

    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...

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: Limiting the .csv file rows count

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
KP-31070522-0 Profile Picture

KP-31070522-0 3

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans