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)

Export Report to CSV

(0) ShareShare
ReportReport
Posted on by 190

Hello everybody, 

I have a requirement where I need to export a report in CSV, but I want the fields to be separated by semicolon(;). 

I have done this up to now:

str csvName;

csvName = strfmt("test");

controller.parmReportContract().parmReportExecutionInfo(new SrsPrintMngmtExecutionInfo());

controller.parmReportContract().parmPrintSettings().printMediumType(SRSPrintMediumType::File);

controller.parmReportContract().parmPrintSettings().fileFormat(SRSFileFormat::CSV);

controller.parmReportContract().parmPrintSettings().overwriteFile(true);

controller.parmReportContract().parmPrintSettings().fileName();

controller.parmReportContract().parmPrintSettings().fileName(csvFileName);

controller.startOperation();

It saves the report in CSV, but the fields are separeted with comma. Istead i need the fields to be separated with semicolon(;).

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi Eva Shehu!

    I think this is a default settings of reporting service.

    Maybe this link will be helpful: https://social.technet.microsoft.com/Forums/sqlserver/en-US/82216397-8757-460b-b7a0-b39e3c2880c9/ssrs-how-to-export-to-a-semicolon-delimited-file?forum=sqlreportingservices

  • Suggested answer
    Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    SSRS supports it, therefore it might be doable.

    One option is changing the default delimited in DeviceInfo section of RSReportServer.config. SSRS documentation, namely CSV Device Information Settings, tells you that must change FieldDelimiter.

    If you want to do just in some cases, you need the ability to set this value in AX in printer settings. It's not supported in AX 2012, but you could add the support by yourself. I'm looking at the code in D365FO, but I'll assume it's the same in AX 2012.

    deviceInfo() method of SRSPrintDestinationSettings class constructs DeviceInfo (XML snippet) with information about print format. It doesn't set anything specific to CSV, but you can change it. Therefore you could add a new member variable for field delimiter, an accessor method allowing to set the value and then add FieldDelimiter element with the right value in deviceInfo().

    I didn't test it, but I think it should work.

  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    Hi Eva,

    Can you tell what exact data needs to be exported as CSV? You can probably use Data Import Export Framework as alternative. This tool is created for import and export data in specific formats.

  • Elda Mataj Profile Picture
    190 on at

    Thank-you for your answer @Martin Dráb.

    I am trying to set the field delimiter in this way.

    Firstly, In class declaration of SRSPrintDestinationSettings Class, i have declared fieldDelimiter variable, as:

    Delimiter fieldDelimiter

    Then, in SRSPrintDestinationSettings Class, I have created 2 new methods:

    1) FieldDelimiter method as below:

    public Delimiter fieldDelimiter(Delimiter _fieldDelimiter = fieldDelimiter)

    {

       fieldDelimiter = _fieldDelimiter;

        return fieldDelimiter;

    }

    2) csvFile method, as below:

    public void csvFile()

    {

       CommaTextIo commaTextIo;

       commaTextIo = new CommaTextIo(fileName, "W");

       commaTextIo.outFieldDelimiter("fieldDelimiter");

    }

    Then, on deviceInfo method, I have called csvFile method:

    case SRSReportFielFormat::CSV:

    this.csvFile();

    On reportController, I set the value of fieldDelimiter method, as below:

    controller.parmReportContract().parmPrintSettings().fieldDelimiter(;);

    But still the fields are separated with comma(,), not semicolon(;).

    Can anyone give any suggestion, why it still separates the fields with comma(,)?

    Thank -you!

  • Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    My solution is about using SSRS, not CommaTextIo, therefore you're doing something else than what I suggested.

    Even if you want to use CommaTextIo (although I have no idea how), notice that you csvFile() method merely creates an instance but never uses it, therefore it has no effect at all. And you what you pass to outFieldDelimiter() is text "fieldDelimiter", not the variable.

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
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
GL-01081504-0 Profile Picture

GL-01081504-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans