Fletch Posted April 22, 2009 Posted April 22, 2009 I'm placing variable mailing information into a letterhead. Some of the records do not have any information in some of the fields. (ie. business name) When one of the records is like this, I want FP to 'Not' leave a blank space where the variable information for that particular field is located. In addition, I have a 'comma' set to be between my city and state fields. Some of my records do not include city and state, but FP still prints the comma. Can this be set to not happen?
esmith Posted April 22, 2009 Posted April 22, 2009 Woot! I think I can answer this one. I'm placing variable mailing information into a letterhead. Some of the records do not have any information in some of the fields. (ie. business name) When one of the records is like this, I want FP to 'Not' leave a blank space where the variable information for that particular field is located. After setting all your variable elements, select everything in the Variable Text Editor window, click on the Paragraph... button, and check the box for "Suppress if: <empty>." In addition, I have a 'comma' set to be between my city and state fields. Some of my records do not include city and state, but FP still prints the comma. Can this be set to not happen? For this scenario, I have a recurring rule that I use: if (Field("CITY") == "" && Field("ST") == "" && Field("ZIP") == "") { return ""; } else return Field("CITY") + ", " + Field("ST") + " " + Field("ZIP"); With this code and the "suppress if empty" check above, this line in my variable text box will drop out if the fields are empty.
esmith Posted April 22, 2009 Posted April 22, 2009 if (Field("CITY") == "" && Field("ST") == "" && Field("ZIP") == "") { return ""; } else return Field("CITY") + ", " + Field("ST") + " " + Field("ZIP"); Or, in light of what I learned today in a different thread, you could also use the following: var CityStZip = (!Field("City") && !Field("St") && !Field("ZIP+4")) ? "" : Field("City") + ", " + Field("St") + " " + Field("ZIP+4"); return CityStZip;
Fletch Posted April 22, 2009 Author Posted April 22, 2009 Should I see an immediate result in Preview mode? If so, then it's not working. Could it be because my file is comma delimited?
Fletch Posted April 22, 2009 Author Posted April 22, 2009 I got it! I didn't 'Highlight' all the fields before I selected the 'Supress- command. All is good now. Thanks for the great information.
rpaterick Posted April 23, 2009 Posted April 23, 2009 I got it! I didn't 'Highlight' all the fields before I selected the 'Supress- command. All is good now. Thanks for the great information. I actually wish this would automatically be checked on text boxes and the users that don't want this would have to go and "un-check" it. Saves an extra step on standard address blocks, such as address line 2.
Dan Korn Posted April 23, 2009 Posted April 23, 2009 I actually wish this would automatically be checked on text boxes and the users that don't want this would have to go and "un-check" it. Saves an extra step on standard address blocks, such as address line 2. Right, but then whenever anyone intentionally typed a blank line, such as to separate paragraphs, it would automatically be suppressed, with no obvious explanation. I can't imagine all the calls we'd get about that.
rpaterick Posted April 23, 2009 Posted April 23, 2009 Right, but then whenever anyone intentionally typed a blank line, such as to separate paragraphs, it would automatically be suppressed, with no obvious explanation. I can't imagine all the calls we'd get about that. I was thinking more along the lines of "empty" data cells but hear ya on that it would probably be more of a problem with it checked.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.