Monday, March 19, 2012

Currency to text conversion

Does anyone have an easy way to convert currency to text ($50.00 - Fifty Dollars) for writing checks in reporting services

Thanks

You'll have to convert it from VBA to VB.NET or C#, but this looks like what you want:http://www.ozgrid.com/VBA/CurrencyToWords.htm|||

Thanks thats what I was looking for.

If it helps anyone else this code can be used "as is" (except it didn't like the REDIM statement) and embeded into the report itself. Reports support embedded code that can be entered through the report's property dialog on the Code tab. The function can then be accessed throughout the report as a member of the class called Code. In this case =Code.ConvertCurrencyToEnglish(First(Fields!Amount.Value)). Note that the expression editor showed a squigly line under the ConvertCurrencyToEnglish and a popup indicated "Unrecoginized Identifier" however the code did run. Note also that the code section only supports VB. If you prefer C# or another .NET language, you'll have to access a separate .NET assembly.

More info can be found here.

http://msdn.microsoft.com/msdnmag/issues/06/07/DataPoints/

No comments:

Post a Comment