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)

How to get Amount in words of the sum(debit) or sum(Credit) amount on ledgerjournal report?

(0) ShareShare
ReportReport
Posted on by 335

How to get Amount in words of the sum(debit) or sum(Credit) amount on ledgerjournal report?

i want to get sum(debit) or sum(debit) on the basis of journal number and also voucher #.

Note: its and system default report and then class  LedgerJournalDP extends SrsReportDataProviderPreProcessTempDB

for example:

Debit Credit

100

200

500

800
800 800 Amount in words: Eight hundred rupees

* i did some thing like that but nothing achieved.

private void updateAmountInWords()
{
    ledgerJournalTmp   ledgerJournalTmp2,ledgerJournalTmp3;
    ;
    ttsBegin;

    while select sum(TotalAmountSumCredit) from ledgerJournalTmp2
    group by ledgerJournalTmp2.JournalNum
    {
        while select forUpdate ledgerJournalTmp3
        where ledgerJournalTmp3.JournalNum == ledgerJournalTmp2.JournalNum
        {
            //ledgerJournalTmp.AmountInWords ="OMG";
            ledgerJournalTmp3.AmountInWords = Global::numeralsToTxt(ledgerJournalTmp2.TotalAmountSumCredit);
            ledgerJournalTmp3.update();
        }
    }

    ttsCommit;
}

please help me.

regards

zeeshan

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    Do you see any value in ledgerJournalTmp2.TotalAmountSumCredit? Pl. put the infolog and check the result?

    Try to pass some static value and see the result. 

     

    Hope this helps you.

    Regards,

    Vishal Salot

  • Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    to get amount in words is not an issue.

    issue is how journal lines are displayed, how those are grouped on SSRS and what is end sum of those on SSRS level.

    on other hand SSRS does not allows you to write vb script as we were able to do in prior versions of ax,

    can you kindly put a screenshot of your report output

  • Zeeshan Adeel Profile Picture
    335 on at

    rpt.jpg

    here it is and i want to convert 7918 to amount in words ...

    dear Shoaib, this is ledgerjournal report (system default), we want to customized it according to our requirement.

    i have done almost all the points but stuck in now on amount in words.

    regards

    zeeshan

  • Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    kindly provide us below information

    1) the path to run this report. how you run this report (this is needed because report can be opened from more than one location)

    2) have you changed any grouping of report on SSRS level?

    3) what is version of your AX, application version

  • Zeeshan Adeel Profile Picture
    335 on at

    1) the path to run this report. how you run this report (this is needed because report can be opened from more than one location)

    ANS: General Ledger > Journals > select a journal and print menu > journal

    2) have you changed any grouping of report on SSRS level?

    ANS: there is no change of grouping on SSRS level

    3) what is version of your AX, application version

    ANS: AX 2012 R3

  • Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    Double entry bookkeeping tells us, always DEBIT = CREDIT. So I don’t expect a situation where AX may allow you to post a journal where DEBIT != CREDIT. So let’s suppose 1st point debit will always be equal to credit as you will print report.

    Now let’s come to your real issue. That is printing of amount in words. You have to take a number, so you may take either sum of debit side or sum of credit side, does not matter, because both will be equal always.

    Next question can be, how we can display total; well it’s not easy to write code on SSR, since the removal of VB Scripts from SSRS-AX. Though methods and display methods are still supported in some way. In short, the best way is to write code of Global::AmoutInwords… inside AX and throw this along with data to SSSRS.

    Finally we need to see, how we can do it technically: we need to have a look at its DP class as well as at SSRS design.

    If we look at SSRS design, the report is being grouped by two fields

    1. Journal Num

    2. Curreny Code

      LedgerJournalReportSC1.png

       

      We can write code in DP class inside process report, after already existing code is ending. As you can see author of ax also updating ledgerJournalTmp (Table) multiple times, after data is inserted in temp table.

      Same you need to do, you need to add your code there in processReport method of DP Class. And update ledgerJournalTmp(table) after everything is finished. Make sure to collect sum by journalNum and CurrenyCode before you throw amountInWords to a new field of ledgerJournalTmp

  • Zeeshan Adeel Profile Picture
    335 on at

    mention above method on the post is updateAmountInWords() method, and i call this method after insertLedgerJournalTmp() method. also checked at the end of the process report method but nothing comes right. please look my updateAmountInWords() method and suggest some thing. Shukriya!

  • Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    your method does not seems practical, so you should not expect any outcome because of below reason:

    you are declaring object for ledgerJournalTmp    again inside this method, so it goes out of context.

    if you want to get sum of amount of current buffer of ledgerJournalTmp  , you code must be adjusted to accept current buffer, else your code will always be returning nothing.

    This was the reason because of which I advised you to write code at end of processReport method and use existing buffer of ledgerJournalTmp. declaring its object again seems useless/extra work

  • Verified answer
    Zeeshan Adeel Profile Picture
    335 on at

    got my result using a simple trick.

    1. Declare a real variable in class    real SumJournalNum;

    2. use this code at the end of insertLedgerJournalTmp Method

       SumJournalNum += _ledgerJournalTrans.AmountCurCredit;

    3. and update ledgerJournalTmp table at the end of process report method.

       update_recordSet ledgerJournalTmp setting

        AmountInWords=Global::numeralsToTxt(SumJournalNum);

    thank you Sohaib and Vishal for helping me.

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