Got more questions? Find advice on: SQL | XML | Regular Expressions | Windows
in Search
Welcome to AspAdvice Sign in | Join | Help

Crystal .NET Blog

Sample codes, tips, random rantings on Crystal Reports, Crystal Enterprise etc...

CR.NET and formatting percentages

I just discovered a new trick for getting CR.NET to automatically format a number as a percentage. For example, let's say you have a number 55.99 and you want it to be printed as 55.99%. What I have done in the past is convert the number to a string and concatenate the '%' character to the end. Not bad if you only have to do this to one number, but a pain if you have to do this to more than one field. I was jealous of how CR stand-alone version has a '%' button that you click and it formats it automatically.
 
I went into CR10 and analyzed what is happening behind the scenes when you click on the '%' button. I found out that the button tells CR that the field is a currency value and it replaces the '$' with a '%'instead. Plus, it tells it to right-align the “currency symbol“. Wow, what a discovery. Here's how to do it in CR.NET. It looks like a lot of steps, but after you doing it the first time it is a breeze.
 
To format a number as a percentage in CR.NET:
  1. Right-click on the numeric field and select Format.
  2. Go to the Number tab and click Customize.
  3. Click the Currency Symbol tab.
  4. Click Enable Currency Symbol.
  5. Change the Currency Symbol to '%'
  6. Change Position combobox to '-123%'
  7. Click OK, OK to exit and save.
Hope this helps,
 
Brian Bischof
 
 
Sponsor
Published Tuesday, November 30, 2004 5:01 PM by crystal

Comments

 

crystal said:

Hi Brian,
Talking of formatting,I need to display the address list of certain customers so that they can cut up and paste it on mail envelope.
My problem is that how to arrange the mailing list ,two at a time horizontally so that I can utilize horizontal space and save paper?
July 25, 2005 6:57 AM
 

crystal said:

This was right on time! Thanks for sharing this.
August 29, 2005 7:15 AM
Anonymous comments are disabled