Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#s in numeric field 1

Status
Not open for further replies.

kutoose

Technical User
Sep 11, 2002
169
US
I have calculated fields which are currency fields in group footer and report footer. If the money field is bigger than the field in the report it will show #s. Some places it truncates the digits.

How to get around it ?

Also how will I calculate the size of a field ? I mean if I have a numeric field how can I find how many digits it can contain ?

Thanks
 
The maximum number of digits depends on the datatype and size of the field you are reporting from. I usually do not set items based on "max size" but rather on reasonable size (if there is one). For instance, I have a field that is an int.. which could have 8 digits.. but I know that 6 is really the max I am going to have for a long time.. so.. i size it for 6 digits. If i am adding up dollars.. i look at the likely value (and add one :)) .. If you want to make certain that they are never truncated or show #'.. set the field to "can grow" it can make your report really ugly, but can also help in the layout.

Lisa
 
Maybe I've misunderstood, but I've a notion you just need to make the display fields bigger. Crystal has the odd habbit of using hashes to indicate a lack of space, rather than truncating.

Madawc Williams
East Anglia
Great Britain
 
But lyanch,
I cannot use 'Can grow' for the Numeric field.

Thanks Madawc,
But I am really lacking space in report. Need to squeeze every thing. The #s are showing in the group footer where I summerize money field
 
You can put numeric results in a text field, using 'totext' to allow a mix of numerics and text. And in that case you would be able to use 'can grow'.

Another solution is to use a smaller point-size or a more compressed text for the larger values. Left-click and select [Format field] to find these options, which can be based on a formula.

A third solution is to round up to hundreds or thousands

Madawc Williams
East Anglia
Great Britain
 
You are seeing #s because you have the 'Allow Field Clipping' option turned off.

Turning this option on can be dangerous because if you have only sized your field for 4 digits, and it turns out to be 5 digits long, rather than display # - meaning the field is not big enough to display the value - it will display the first 4 digits, and hide the fifth digit.

You can't dynamically size your field during run time, so either size your field for the maximum field length to start with, or turn the 'Allow Field Clipping' option on if you don't mind truncating your fields.

Naith
 
You should have some idea as to the maximum size of the numbers that you are generating.

So just size your field for the Maximum size + 1 digit at design time...if that is not possible at the current font because of real estate issues then drop your font one point and that should do the trick. (of course you may have to reformat the fonts of the other fields to make this look good.

Sizing of numeric fields is always a problem when constructing a multi-column report with sums at the bottom because of real estate issues

One solution I had for a particular problem was not to put the sums exactly under the columns of numbers but rather place the sums in a "summary" table in the footer. It worked/looked better that way...


Jim Broadbent
 
An alternative is to alter the font size dynamically if the field is over a set length. It looks a bit hokey, but when it's the exception and you don't have the real estate...

If it's a numeric you can use:

if len(totext({table.value},2,"")) > 10 then
10
else
12

-k
 
synapsevampire,
Where should I format the font size ? Please help....
 
Also can you explain

what ,2,"")) do in the function totext({table.value},2,""))


Thanks !!!
 
Right click the field and select format field->Font->X-2 Next to Size

The ,2,"" says 2 decimal places, and no thousands delimiter.

-k
 
Thanks synapsevampire,
I tried in a test report it works !!! Also can you tell me how to make a field bold or unbold using the length of a field ???

Thanks a million. I am giving a star to you !!!
 
Right click the field and select format field->Font->X-2 Next to Style:

if len(totext({table.value},2,"")) > 10 then
crbold
else
crregular

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top