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

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

HI Balu,

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

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

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…

Hi Balu,

maybe u can try using this:

display str Total()

{

Total = VendPurchOrder.Amount;

return global::num2Text(Total);

}

Regards,

Dar

It is also not working

Hi Balu,

try this:

display str60 Total()

{

Total = VendPurchOrder.Amount;

return strfmt("%1", Total);

}

Regards,

Dar

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

Hi Balu,

Try this

in class declaration

AmountCur Total;

and in display Method

display AmountCur getTotal()

{

;

Total = VendorPurchOrder.Amount;

return Total;

}

Hi

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

display str Total()

{

return global::numeralsToTxt_EN(VendPurchOrderJour.Amount);

}

Thanks,

Balu