web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Positive pay CSV file not respecting number format

(0) ShareShare
ReportReport
Posted on by 1,457

I used this link: https://community.dynamics.com/ax/b/axatoz/archive/2019/03/07/d365-positive-pay-file-wells-fargo to create my file for the positive pay format and to do the extension on BankPositivePayExport to replace the default XML-output type with a CSV-output type.

The file is generated as a CSV-file and I am presented with that to save or open.

When I open the file using Notepad, the number formatting is respected. However when I open it in Excel, it throws away the trailing zeroes.

I need to show $30 as 30.00 and it does in notepad, but once opened in Excel, it shows as just: 30.

/* Snippet out of my positive pay file:

 <xsl:variable name="amtdec" select="AMOUNTCUR" />
 <xsl:value-of select="format-number($amtdec, '#.00')" />

1643.pp1.jpg

Opened in Excel:

31327.pp2.jpg

Also look at the 1286.9 that shows in Notepad correct as 1286.90

My whole file:

<xsl:stylesheet version="1.0"
                xmlns:xsl="www.w3.org/.../Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                exclude-result-prefixes="msxsl xslthelper"
                xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02"
                xmlns:xsi="www.w3.org/.../XMLSchema-instance"
                xmlns:xslthelper="schemas.microsoft.com/.../xslthelper">
  <xsl:output method="text" omit-xml-declaration="yes" version="1.0" encoding="utf-8"/>
  <xsl:template match="/">
    <xsl:value-of select="''" />
    <Document>
      <xsl:value-of select="''" />

      <xsl:for-each select="Document/BANKPOSITIVEPAYEXPORTENTITY">

        <!--Cheque Detail begin-->
      <xsl:value-of select="ACCOUNTNUM/text()"/>
      <xsl:value-of select='string(",")'/>
      <xsl:value-of select='string("Reg")'/>
      <xsl:value-of select='string(",")'/>
      <xsl:variable name="amtdec" select="AMOUNTCUR" />
      <xsl:value-of select="format-number($amtdec, '#.00')" />
      <xsl:value-of select='string(",")'/>
      <xsl:value-of select="normalize-space(CHEQUENUM/text())"/>
      <xsl:value-of select='string(",")'/>
      <xsl:variable name="year" select="substring(TRANSDATE/text(),1,4)" />
      <xsl:variable name="month" select="substring(TRANSDATE/text(),6,2)" />
      <xsl:variable name="day" select="substring(TRANSDATE/text(),9,2)" />
      <xsl:value-of select="concat($day,'/',$month,'/',$year)" />
      <xsl:text>&#13;&#10;</xsl:text>
      </xsl:for-each>
    </Document>
  </xsl:template>
</xsl:stylesheet>

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    BrandonSA Profile Picture
    1,673 on at

    Hi

    You probably need to format the column in Excel. You might need to configure how many decimal values are displayed. What is the current format in Excel of that column?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    CSV is just text (no formatting), so Excel needs to guess how it should be formatted, and it doesn't always guess right. So you need to tell it what kind of formatting you want.

    As you see in notepad, the number in the file is correct. Your problem is in the formatting settings of Excel (not related to AX or the file), you need to change them for this column.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans