James Posted January 10, 2013 Share Posted January 10, 2013 I am having an issue with getting longer names to fill space properly. On the attachment, the left image is exactly what I want and works great for smaller names, but if I have a name that is longer (seems like 8 characters is the number) it makes it tiny (image on right). I looked for someone else who had my problem and found this, it's close, but not exactly what I need. http://forums.pti.com/showthread.php?t=1093 Based on the above post I came up with the following to fit my needs. var len = Field("First Name").length; if (len >= 8) return Resource("Name Length"); //else return ""; It does make the longer names fit, however it removes the shorter names instead of keeping them how they were (which is perfect). What am I doing wrong? THANKS! James Quote Link to comment Share on other sites More sharing options...
esmith Posted January 10, 2013 Share Posted January 10, 2013 It does make the longer names fit, however it removes the shorter names instead of keeping them how they were (which is perfect). What am I doing wrong? The code you included is returning a resource when length of first name is 8 or more characters otherwise returning nothing. The last line should read: else return Field("First Name"); This scenario looks like it would benefit from the TextMeasure function, but I'm not sure what you are trying to accomplish for names with 8 or more characters. Quote Link to comment Share on other sites More sharing options...
James Posted January 10, 2013 Author Share Posted January 10, 2013 Hmmm. That helped with the longer name, but replaced the shorter names with the name of the rule. I've attached what I'm trying to accomplish with the longer names. I know once I figure it out for the first names I will be able to apply that to the longer middle names. Thanks for the help! Quote Link to comment Share on other sites More sharing options...
esmith Posted January 10, 2013 Share Posted January 10, 2013 Hmmm. That helped with the longer name, but replaced the shorter names with the name of the rule. That doesn't make much sense. You were already returning return Resource("Name Length"); for names that were greater than 7 characters. My code addition should return First Name value for records with a first name of 7 or less characters.. What does the resource contain (i.e. what is returned for longer first names)? Quote Link to comment Share on other sites More sharing options...
James Posted January 10, 2013 Author Share Posted January 10, 2013 Here is the source code, is that what you are asking for? <p style="(no style)" br="false" override="true" quad="C" findent="0" lindent="0" rindent="0" leadbefore="0" leadafter="0" widows="2" kerning="true" hyphenate="true" skipifempty="false" skipifemptyvar="false" noparabreakoncopyfit="true"><tracking newsize="0"><f Name="Jellyka Delicious Cake"><z newsize="200.0"><color Name="C=2 M=2 Y=2 K=0"><variable Name="First Name"> Quote Link to comment Share on other sites More sharing options...
James Posted January 16, 2013 Author Share Posted January 16, 2013 After putting this on the back burner for a few days I came back to it today and IT WORKS! I cleared out my rule, started over and it works great. Thanks Eric, I really appreciate your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.