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!

VFP 7 Variable in report or label does not truncate in detail band

Status
Not open for further replies.

fitedgar

MIS
Apr 24, 2002
238
US
I have variable lc_desc "1234567890123" ( 13 chars)
In the report I have a field : "Desc:" + lc_desc
It prints fine: "Desc: 1234567890123"
In the report when I increase the size of lc_desc to 25 chars, lc_desc "1234567890123456789012345"
It prints: "Desc:". The value of the variable does not print. I am aware thetif I increase the size of the report field, it prints.
Is there a way to tell VFP to truncate and print. for example "Desc: 1234567890123457"

Thank you,
Dave
 
If you already know that the report/label form will only allow 13 characters (or any limited number of fixed characters) you can always modify the Expression to something like:
Code:
"Desc:" + LEFT(lc_desc,13)  && or whatever limited number of char

Good Luck,
JRB-Bldr

 
Assuming you're in VFP 9 SP 2 (maybe any VFP 9, I'm not sure), on the Format tab of the Field Properties dialog, you can set the Trim mode.

Tamar
 
Thank you all for your reply.
JRBBLDR, it will not work since the limit may not be 13 characters.

I resolved the problem by creating a label: Desc.:
Next to it I used the field lc_desc.

EX. DESC.:( label) lc_desc (field)
It now truncates to width of field.

Thank you
Dave
 
Tamar is more to the point, report fields by default truncate full words and since there is no space in a long number it's fully truncated. There are other trim modes, though.
If the report worked, this may be due to the general change, which happened in VFP9 causing the need to adjust all reports field to be slightly wider: GDI+ rendering of texts.

You might now never find out what happened, but take a look at trim options of a reoport field:
trimmode_nfsg6o.png


The field could have been set to trim whole words, and then only the "Desc.:" remained.

Bye, Olaf.
 
Thank you Mike and all. It is very strange VFP7 behavior.

Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top