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 :
Finance | Project Operations, Human Resources, ...
Answered

we are using closed xml library to export a excel file from AX with type csv comma delimited

(0) ShareShare
ReportReport
Posted on by 90

Hi All,

when we try to open the csv file with note pad after it was exported from AX through the closedXML library, the file opens in different format with different characters inside as per below pic , so we have to manually save the file as csv comma delimted then it open with correct format, how can we solve this issue that after the export it opens in right format ?

pastedimage1573567404514v1.png

Thank you,

I have the same question (0)
  • MDeeb Profile Picture
    90 on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    Thanks a lot Nikolaos, the team has used the TextIO, and is exporting it to CSV.

    Thanks.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    Sorry, actually you need to use TextIO instead of CommaIO if you don't want to have the quotation marks. In normal CSV string values are surrounded by quotation marks, to avoid issues where the string field contains the delimiter character (such as comma).

    Are you sure it's not ok to have the quotation marks there? I would assume that the application who reads this file knows how to handle it.

  • MDeeb Profile Picture
    90 on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    Thank you Nikolaos, replaced the write with writeexp but with same output.

    Regards,

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    Try commaIo.WriteExp method instead of the write method.

  • MDeeb Profile Picture
    90 on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    Thank you Nikolaos for your response : below is the code and the output 

    pastedimage1573725437433v1.png

    pastedimage1573725456907v2.png

  • nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    Instead of removing, I would focus on not writing the quotation marks in the file in the first place.

    How to do that in your case depends quite a lot on your implementation. Perhaps you can share your code, then we can suggest how to change it?

  • MDeeb Profile Picture
    90 on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    Hi Martin,

    i have a question please :

    we are trying to generate a csv file when the WF is completed. the file is generated successfully but when we try to open it with note pad the value appear with "" is there any way to remove the ""  .

    Thank you

  • MDeeb Profile Picture
    90 on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    Thank you Martin.

  • Verified answer
    Martin Dráb Profile Picture
    235,818 Most Valuable Professional on at
    RE: we are using closed xml library to export a excel file from AX with type csv comma delimited

    This is not a CSV file. It's an Excel file, which isn't a huge surprise, since you used a library for working with Excel files.

    So either your fine with getting an Excel file, or you'll have to change your implementation.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 665 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 595 Most Valuable Professional

#3
Yng Lih Profile Picture

Yng Lih 558

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans