Page 1 of 1

Problem in ToCurrencyWord()

Posted: Wed Sep 01, 2010 5:46 am
by albloshi
Good Day Dear fellows,

I want to have words for a currency amount.

Like 1200.50 > One thousand Two hundred Riyal and Fifty Halalah

I have a datatable which has the amount column with a double value.

I am using {ToCurrencyWords(datatable.myAmount,true,true,'Riyal','Halalah')} on my report

There is no error during compling

and the result on the report is

{Stimulsoft.Report.Dictionary.StiFunctionsStrings.ToCurrencyWords(20,true,true,'SAR','H')}

I also tried using double quotes
{ToCurrencyWords(datatable.myAmount,true,true,"Riyal","Halalah")}

but still no luck

I anticipate a quick response
Thanks

Problem in ToCurrencyWord()

Posted: Wed Sep 01, 2010 6:05 am
by Alex K.
Hello,

Change your expression :

Code: Select all

{ToCurrencyWords(datatable.myAmount,true,true,"Riyal","Halalah")} 
on

Code: Select all

{ToCurrencyWords(datatable.myAmount,true,true,"Riyal/Rival","Halalah/Halalah")} 
Thank you.

Problem in ToCurrencyWord()

Posted: Wed Sep 01, 2010 6:08 am
by albloshi
Thanks it works

Problem in ToCurrencyWord()

Posted: Wed Sep 01, 2010 6:18 am
by Andrew
Ok! Have a nice day!

Problem in ToCurrencyWord()

Posted: Fri Sep 03, 2010 3:52 am
by stvhui
Hello All,
I'm newbie using VB.NET 2005, Stimulsoft Report 2010.

Let in report designer contains:
datasource named as dt, contains columns as InvoiceNo, CustomerName, Amount

I can showing the reports successfully.

But how can displaying "Amount in words" ?
In VB module I have created a function named as AmountInWords
usage: AmountInWords(11) will return eleven

I want to use the function on amount's value.

Please give me its concept & guide me step by step.

Thanks in advance
Steven

Problem in ToCurrencyWord()

Posted: Fri Sep 03, 2010 6:24 am
by Alex K.
Hello

You can add your function in code of reports:

Code: Select all

public class Report : Stimulsoft.Report.StiReport
{
     public string MyFunction(int n)
     {	
           if (n == 11)
           {
                 return "eleven";
           }
           else
           {
                 return "not eleven";
           }
     }    

     public Report()
     {
           this.InitializeComponent();
     }
    #region StiReport Designer generated code - do not modify
and use {MyFunction(Amoint)}

Thank you.

Problem in ToCurrencyWord()

Posted: Fri Sep 03, 2010 10:12 pm
by stvhui
Hello Aleksey,

Thanks for yr guidance.

Where should I put the {MyFunction(amount)} ?

I tried to create new calculated column, then the value box with {MyFunction(dt.amount)}, but NOT WORKS!
Could you, guide me step by step?


Another questions is:
You means I should put the function into code of report.
If I had 50 reports, so must be inserted the function into all of the reports.

In my mind, Is there any simple way, just stored the function into VB.NET module, then can be called from Stimulsoft report.

Is there any simple way?

Please advice & thanks in advance.

Problem in ToCurrencyWord()

Posted: Mon Sep 06, 2010 1:07 am
by Alex K.
Hello,

You can see live video for this issue:
http://www.stimulsoft.com/livedemos/Rep ... ction.html


Thank you.

Re: Problem in ToCurrencyWord()

Posted: Tue Dec 19, 2017 10:27 am
by Manu Radhakrishnan
Good Afternoon.

I want to have words for a currency amount with a better currency formatting.
I am using {ToCurrencyWords(datatable.myAmount,true,true,"INR/INR","PAISE/PAISE")} on my report.

Now I need to change the Currency string based on the data from the backend. I am storing the value in two variables 'code' and 'subcode'.
From the backend, if it is Dollar and Cent it should show that value and so on.

I use this code
{ToCurrencyWords(122.23,true,true,DataSource1.code,DataSource1.subcode)}

While compiling, there are no errors. But output screen is blank.

How can I apply variables in this function?

waiting for your immediate reply.

Regards
Manu Radhakrishnan

Re: Problem in ToCurrencyWord()

Posted: Thu Dec 21, 2017 5:42 pm
by HighAley
Hello, Manu.

You expression is working right. Please, check the attached report template.
ToCurrency.png
ToCurrency.png (2.05 KiB) Viewed 4584 times
Thank you.