Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Number to Words Post Reply Post New Topic
Author Message
CluelessII
Newbie
Newbie


Joined: 26 Mar 2010
Online Status: Offline
Posts: 5
Quote CluelessII Replybullet Topic: Number to Words
    Posted: 26 Mar 2010 at 7:43am
I am very new to this. I have had some CR classes but no SQL.
I have report in CR and in this report the Clearance Status is numeric Example: 0.00; 9001;9002.00 etc up to 9005.00. Each of these sets mean
Not cleared; unfounded etc. I need to convert these numbers to what they actually mean in words. Can this be done, if so what would the formula be.
Thanks
CluelessII
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 29 Mar 2010 at 9:50am

You could use something like this

 
stringvar status := "";
if {fieldname} = 9001 THEN
status := "Not Cleared"
else
if {fieldname} = 9002 THEN
status := "Unfounded"
 
and so on...
 
I generally add a ';' on the last line of the if then statement  and then add a line for the variable in this case it would look like this
 
status;
 
 
Also you could use a Select - Case statement instead of the If - Then.
 
Hope this helps.
 
Regards,
 
John W.


Edited by jkwrpc - 29 Mar 2010 at 9:51am
IP IP Logged
CluelessII
Newbie
Newbie


Joined: 26 Mar 2010
Online Status: Offline
Posts: 5
Quote CluelessII Replybullet Posted: 31 Mar 2010 at 7:03am
Thank you, I will give this a try.
 
Marie
IP IP Logged
CluelessII
Newbie
Newbie


Joined: 26 Mar 2010
Online Status: Offline
Posts: 5
Quote CluelessII Replybullet Posted: 31 Mar 2010 at 10:54am
Well to my surprise it did not work. Do I need to put a parameter, do i need to use ToText, ToWords, I do not know what else to do.
 
CluelessII


Edited by CluelessII - 31 Mar 2010 at 10:54am
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 01 Apr 2010 at 4:12am
If you could post the formula we may be able to see where it is breaking. You also could always send it to me in a pm if that would be preferable and I will take a look at it for you.

Regards,

John W.
www.CustomReportWriters.net
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.015 seconds.