views:

322

answers:

3

I've got a problem in Crystal Reports that's been bugging me for years, and I wondered if anybody might have a solution. I've got a few fields (data fields and formulae, numeric and string) all aligning to the left in design mode.

When I move to preview mode, the numeric fields never line up with the other fields, and they are slightly indented, maybe by one character. This looks very messy when you're trying to create professional looking reports.

Any ideas how to get them to align correctly?

+1  A: 
  1. Align numbers right - much nicer to read and more understandable :)
  2. Convert numbers to strings using formulas and display formula results.
  3. Use exactly same fonts for all fields, use guidelines to align fields.
  4. Design entire report on same computer - this is not joke; different computers may have slightly different versions or settings of CR, Windows, fonts etc.
  5. Use text objects and put your numeric fields inside of them - note that this may not work, it is just one more thing to try.

BTW, do you see problems both in preview and in print? Sometimes printed output looks much better than preview - depends on printer driver.

Arvo
Arvo's right. Just convert the number to a string. Perhaps by entering "currentfieldvalue" in the DisplayAs formula box. Personally, what I'd like to know is how to decimal-place-align number fields so the decimal place is always in the same location.
PowerUser
Thanks @Arvo. I was already converting some of my numbers to strings, but there was clearly something wrong with my string format. I've removed the format, and converted the remainder of the numbers to strings - and voila: a perfect report. Thanks!
JamesW
+1  A: 

I think I may have a better and easier solution ;). By standard Crystal Reports puts a space before every numeric field. That space is a spaceholder for the negative sign (-). If you're sure that the numeric value is always a positive value then you can do this:

  1. Open "Format Field" for this field.
  2. Open tab "Number".
  3. Go to "Customize".
  4. Set setting "Negatives" to "None"

Voila!

Ahhhh. Nice one! I'll give that a try at some point. Cheers.
JamesW
A: 

Thanks Mark! Worked like a charm.

KellyS