scotts Posted July 18, 2011 Posted July 18, 2011 I'm sure I'm missing something simple, but I've been looking and trying different things, and can't seem to get this to work. This rule builds the address line. Division:<space>Street, City, State<space>Zip ( BOLD ) (Normal ) If the Division field if filled it will insert the Division field with the colon and a space with the font Bold, then the rest of the address line with the font Regular. Otherwise it will omit the Division, colon, and space, and just output the rest of the address line. Below is my rule. if ((Field("Division") != "") && (Field("Street") != "")) { return "<span>" + "<f name=('Times-Bold')>" + Field("Division") + ": " + "</f>" + "</span>" + Field("Street") + ", " + Field("City") + ", " + Field("State") + " " + Field("Zip"); } else { return Field("Street") + ", " + Field("City") + ", " + Field("State") + " " + Field("Zip"); }
Andre Globensky Posted July 18, 2011 Posted July 18, 2011 first line, looks like you have a parentheses too much if (Field("Division") != "")
scotts Posted July 18, 2011 Author Posted July 18, 2011 The first line needs both parentheses because it is a conditional if statement. if ((Field("Division") != "") && (Field("Street") != "")) If Division is not equal to "" AND Street is not equal to "" then return.
Dan Korn Posted July 18, 2011 Posted July 18, 2011 If the Division field if filled it will insert the Division field with the colon and a space with the font Bold, then the rest of the address line with the font Regular. If you only want to make the text bold, you don't need to change the font family; you can just use a <b> tag (and ending </b> tag), like so: return "<b>" + Field("Division") + ": " + "</b>" + Field("Street") + ", " + Field("City") + ", " + Field("State") + " " + Field("Zip");
Andre Globensky Posted July 18, 2011 Posted July 18, 2011 scratch my last post... make sure your font is able to have bold and regular.. add the <b> </b> to your code if ((Field("Division") != "") && (Field("Street") != "")) { return "<span>" + "<f name=('Times')> <b>" + Field("Division") + ": " + "</b> </f>" + "</span>" + Field("Street") + ", " + Field("City") + ", " + Field("State") + " " + Field("Zip"); } else { return Field("Street") + ", " + Field("City") + ", " + Field("State") + " " + Field("Zip"); }
Dan Korn Posted July 19, 2011 Posted July 19, 2011 scratch my last post... make sure your font is able to have bold and regular.. add the <b> </b> to your code if ((Field("Division") != "") && (Field("Street") != "")) { return "<span>" + "<f name=('Times')> <b>" + Field("Division") + ": " + "</b> </f>" + "</span>" + Field("Street") + ", " + Field("City") + ", " + Field("State") + " " + Field("Zip"); } else { return Field("Street") + ", " + Field("City") + ", " + Field("State") + " " + Field("Zip"); } That's still not quite right if you want to change the font family as well. Try this: return[color=Green] '<f name="Times"><b>'[/color] + Field("Division") + ": " + "</b></f>" + Field("Street") + ", " + Field("City") + ", " + Field("State") + " " + Field("Zip");
Recommended Posts
Archived
This topic is now archived and is closed to further replies.