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!

How do truncate a field 1

Status
Not open for further replies.

jfield817

Programmer
Jun 2, 2000
153
US
I want to print only the first 10 characters from
a varchar field from an SQL Server table without using a
Formula ......Seems I saw it done in another report but dont know how it was accomplished ...

Is that possible ...

thanks

john
 
If you use a fixed width font, like courrier, you can simply size the field to that number of characters. However, most Windows fonts are proportional, allowing more space for 'M' than they do for 'i'. So your fonts will be limited.

Otherwise I am pretty sure you will need a formula. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Because Windows is not truly WYSIWYG, you will need to accept the fact that by doing this you run the risk of differences in the number of characters that will show based on
-the OS (especially NT based Windows versions compared to the DOS based Windows versions)
-the default printer used
-the monitor used
-the resolution of the monitor

A properly written formula can avoid these problems. Malcolm
 
Foxfont.fon is a fixed propotion for every character, it will be able to be sized to 10 characters always. It is an old foxpro font.
 
If the client has that font on their machine... If the client doesn't have that font, AND the report was designed with that font, then Windows will guess the closest match. Luckily, Microsoft never makes mistakes... :)
Malcolm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top