Using method in Stimulsoft

Stimulsoft Reports.WEB discussion
Post Reply
LeMinhChau
Posts: 6
Joined: Wed Jun 13, 2012 10:32 pm
Location: PLC

Using method in Stimulsoft

Post by LeMinhChau »

In the report, I want to use a method to execute a case. For example, In this case I want to read the amount to letter. Please tell me, how can to do it with stimulsoft. Thankyou very much!

ex: image attach
Attachments
1940.Untitled.png
1940.Untitled.png (4.7 KiB) Viewed 2231 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Using method in Stimulsoft

Post by Alex K. »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
LeMinhChau
Posts: 6
Joined: Wed Jun 13, 2012 10:32 pm
Location: PLC

Using method in Stimulsoft

Post by LeMinhChau »

I want to read number to words. I usually code in the code behind but I did not report stimulsoft do so is
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Using method in Stimulsoft

Post by Alex K. »

Hello,

You can use the following function:
Totals.ToWords()

Thank you.
LeMinhChau
Posts: 6
Joined: Wed Jun 13, 2012 10:32 pm
Location: PLC

Using method in Stimulsoft

Post by LeMinhChau »

Thanks for answer me. but I want to ask is how to be able to use a funtion on the report?
Ex:
I have a number as Total = 100;
I wanted to use function read money: "one hundred dollars". How to do?

I used to extrareport as follows:
In code behind I write:
txtText.Text = ReadMoney (txtTotal.Text);
ReadMoney() I built a function in the library
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Using method in Stimulsoft

Post by Alex K. »

Hello,

In this case, you can use the following function:
ToCurrencyWords()

Thank you.
LeMinhChau
Posts: 6
Joined: Wed Jun 13, 2012 10:32 pm
Location: PLC

Using method in Stimulsoft

Post by LeMinhChau »

Thankyou Aleksey reply for me!
But I want read money by Vietnamese. I have 1 function. Can i user it in stimulsoft report?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Using method in Stimulsoft

Post by Ivan »

Hello,

You can write your function on the Code tab in the begin of report, for example:

Code: Select all

Namespace Reports
    
    Public Class Report
		Inherits Stimulsoft.Report.StiReport
		
		
		Public Function GetCurrencyString(ByVal numToConvert As integer) As String
			'
			'Place your code here
			'
			Return "new currency string"
		End Function
		
		
        Public Sub New()
            MyBase.New
            Me.InitializeComponent
            .....
and then use this function in expressions, for example:

Code: Select all

{GetCurrencyString(yourDataSource.Field)}
Thank you.
Post Reply