Problem in ToCurrencyWord()

Stimulsoft Reports.NET discussion
Post Reply
albloshi
Posts: 14
Joined: Wed Sep 01, 2010 5:39 am
Location: K.S.A

Problem in ToCurrencyWord()

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem in ToCurrencyWord()

Post 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.
albloshi
Posts: 14
Joined: Wed Sep 01, 2010 5:39 am
Location: K.S.A

Problem in ToCurrencyWord()

Post by albloshi »

Thanks it works
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Problem in ToCurrencyWord()

Post by Andrew »

Ok! Have a nice day!
stvhui
Posts: 51
Joined: Wed Apr 22, 2009 3:12 am

Problem in ToCurrencyWord()

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem in ToCurrencyWord()

Post 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.
stvhui
Posts: 51
Joined: Wed Apr 22, 2009 3:12 am

Problem in ToCurrencyWord()

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Problem in ToCurrencyWord()

Post by Alex K. »

Hello,

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


Thank you.
Manu Radhakrishnan
Posts: 2
Joined: Tue Dec 19, 2017 9:19 am

Re: Problem in ToCurrencyWord()

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem in ToCurrencyWord()

Post by HighAley »

Hello, Manu.

You expression is working right. Please, check the attached report template.
ToCurrency.png
ToCurrency.png (2.05 KiB) Viewed 4563 times
Thank you.
Attachments
sample(1).mrt
(2.61 KiB) Downloaded 486 times
Post Reply