How to write display method to convert the total value in text?

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Verified) This post has 1 verified solution | 9 Replies | 3 Followers

62 Posts
605 Points
Joined: 2012-9-25
Last Online:
2013-6-19 12:08
Balu posted on 2012-9-29 11:41

Hi,

I want to convert Numbers to text  format. I know method but how to call this method in Reports not in jobs.

Global::num2Text(1000);

in place of 1000 I want 'Total'

I dont Know How to assign Amount field  in total variable in display method

How to write display method to convert the total value in text?

 Thanks,

Balu

Solution (Verified) Verified Solution

62 Posts
605 Points
Joined: 2012-9-25
Last Online:
2013-6-19 12:08
Solution (Verified) Balu replied on 2012-10-1 12:29
Verified by Balu

Hi 

I solve this Issue.I wrote this code. It;s working

display str Total()

{

return global::numeralsToTxt_EN(VendPurchOrderJour.Amount);

}

 Thanks,

Balu

All Replies

26 Posts
405 Points
Joined: 2012-7-20
Last Online:
2013-2-2 8:27
Location: Bangalore - India

HI Balu,

 

Have you declared the total variable in one of the methods or in Class declaration.

16 Posts
130 Points
Joined: 2012-9-28
Last Online:
2013-6-14 8:56
Location: Jkt
Dar replied on 2012-10-1 5:32

Hi Balu,

if you're using ax 2009, u need to create display method in the report and assign it.

but if you're using ax 2012, u need to add field ('Total') in the temporary table and insert the value into that ('Total') field from Report Data Provider class.

 

Regards,

Dar

Regards,

Dar

62 Posts
605 Points
Joined: 2012-9-25
Last Online:
2013-6-19 12:08
Balu replied on 2012-10-1 7:42

Hi,

I declared Total variable in Classdeclaration.

but Assigning of total variable in display method is throwing an error i.e Syntax Error.

Code:

 

display AmountCur Total()

{

Total = VendPurchOrder.Amount;

return global::num2Text(Total);

}

 

Total = VendPurchOrder.Amount; ....................It  throws Syntax error

I dont know how to assign this variable.       Pls help me................

16 Posts
130 Points
Joined: 2012-9-28
Last Online:
2013-6-14 8:56
Location: Jkt
Dar replied on 2012-10-1 8:00

Hi Balu,

 

maybe u can try using  this:

 

display str Total()

{

Total = VendPurchOrder.Amount;

return global::num2Text(Total);

}

 

Regards,

Dar

Regards,

Dar

62 Posts
605 Points
Joined: 2012-9-25
Last Online:
2013-6-19 12:08
Balu replied on 2012-10-1 8:17

It is also not working

16 Posts
130 Points
Joined: 2012-9-28
Last Online:
2013-6-14 8:56
Location: Jkt
Dar replied on 2012-10-1 8:42

Hi Balu,

 

try this:

 

display str60 Total()

{

Total = VendPurchOrder.Amount;

return strfmt("%1", Total);

}

 

Regards,

Dar

Regards,

Dar

55 Posts
935 Points
Joined: 2012-5-18
Last Online:
2013-6-15 9:05
Location: INDIA
SAADULLAH replied on 2012-10-1 8:46

Mr Balu, you May assigned Total Variable as Str so Change the DataType of  Total Variable to Int in Class Decleration. Hope it wil work

Don't Forget to Solution (Verified) Verify Solution Cool

Regards

SAADULLAH

www.msdynamicsax.weebly.com

 

26 Posts
405 Points
Joined: 2012-7-20
Last Online:
2013-2-2 8:27
Location: Bangalore - India

Hi Balu,

Try this

 

in class declaration

  AmountCur Total;

 

and in display Method

display AmountCur getTotal()

 {

   ;

  Total = VendorPurchOrder.Amount;

return Total;

}

62 Posts
605 Points
Joined: 2012-9-25
Last Online:
2013-6-19 12:08
Solution (Verified) Balu replied on 2012-10-1 12:29
Verified by Balu

Hi 

I solve this Issue.I wrote this code. It;s working

display str Total()

{

return global::numeralsToTxt_EN(VendPurchOrderJour.Amount);

}

 Thanks,

Balu

Page 1 of 1 (10 items) | Get this RSS feed | Bookmark and Share