Tony Olivas Posted October 16, 2009 Share Posted October 16, 2009 Hello, I trying to figure out why my logic is not working anymore. I upgraded from 4.2 to 6.0. What I did not working anymore: I added a resource graphic (eps file). Then made a graphic rule.(called it graphic). Added a second resource as Formatted Text (named it) edited in the variable text editor and inserted <FName> <LName> <graphic> named it. Then made a rule to return Formatted text with fields and graphic. Made a text frame and inserted rule. Now first and last name prints with a static graphic. What I've done to trouble shoot it. 1) Made sure I did not break the link for the graphic. 2) In Formatted Text resource editor Graphic Rule no longer appears! 3) Made a simple graphic box to return just graphic that works. I've also made a OnRecordStart rule maybe conflict with this rule. Rules should stay same with upgrades I see no reason why this is happening. What do you think? Link to comment Share on other sites More sharing options...
esmith Posted October 16, 2009 Share Posted October 16, 2009 Made a text frame and inserted rule. Now first and last name prints with a static graphic. I'm confused. Isn't this what you are trying to do? Added a second resource as Formatted Text (named it) edited in the variable text editor and inserted <FName> <LName> <graphic> named it. (also) 2) In Formatted Text resource editor Graphic Rule no longer appears! Are you including the resource or the rule in your formatted text? I've also made a OnRecordStart rule maybe conflict with this rule. What is your OnRecordStart rule? Link to comment Share on other sites More sharing options...
Tony Olivas Posted October 16, 2009 Author Share Posted October 16, 2009 esmith, Quote: Originally Posted by Tony Olivas http://forums.printable.com/images/buttons/viewpost.gif Made a text frame and inserted rule. Now first and last name prints with a static graphic. I'm confused. Isn't this what you are trying to do? Yes, that is what I'm trying to do but it does not do it anymore. Quote: Originally Posted by Tony Olivas http://forums.printable.com/images/buttons/viewpost.gif Added a second resource as Formatted Text (named it) edited in the variable text editor and inserted <FName> <LName> <graphic> named it. (also) 2) In Formatted Text resource editor Graphic Rule no longer appears! Are you including the resource or the rule in your formatted text? I'm trying to include the resource but in the insert drop down menu the graphic rule does not apper. What is your OnRecordStart rule? if (Field("MailCode") == "HEPB_NOTO_W1_ENG_FF") { DL100.Composition.SetBodyPageUsage("English_23501", true); } else if (Field("MailCode") == "HEPB_NOTO_W1_CHIN_FF") { DL100.Composition.SetBodyPageUsage("Chinese_23502", true); } else if (Field("MailCode") == "HEPB_NOTO_W1_VIET_FF") { DL100.Composition.SetBodyPageUsage("Vietamese_23503", true); } else if (Field("MailCode") == "HEPB_NOTO_W1_KOR_FF") { DL100.Composition.SetBodyPageUsage("Korean_23504", true); } Link to comment Share on other sites More sharing options...
Tony Olivas Posted October 16, 2009 Author Share Posted October 16, 2009 Is ther a better script to make this work? I want the Korean letter salution to just print Fname and LName with graphic. Link to comment Share on other sites More sharing options...
Tony Olivas Posted October 16, 2009 Author Share Posted October 16, 2009 Why does this expression not work? return Field("FirstName") +(" ") + Field("LastName") + (" ") + Resource("Korean Graphic") Link to comment Share on other sites More sharing options...
esmith Posted October 16, 2009 Share Posted October 16, 2009 return Field("FirstName") + " " + Field("LastName") + " " + Resource("Korean Graphic"); Ditch the parenthesis around the static elements and add a semicolon to the end. Is this being added to a variable graphic or text frame? Link to comment Share on other sites More sharing options...
Tony Olivas Posted October 16, 2009 Author Share Posted October 16, 2009 I wanted the (" ") spaces in between the names. Still did not work I get "FName LastName Resource(Korean Graphic)". Literally. No graphic. Link to comment Share on other sites More sharing options...
LesSjo Posted October 16, 2009 Share Posted October 16, 2009 Added a second resource as Formatted Text (named it) edited in the variable text editor and inserted <FName> <LName> <graphic> named it.Are your fields called FirstName and LastName or FName and LName? return Field("FirstName") + " " + Field("LastName") + " " + Resource("Korean Graphic");Troubleshooting guide for Resource names: should not include spaces. If the Field names and Resource names are correct, keeping the spaces in the return line should still work. i.e. KoreanGraphic - not Korean Graphic (as long as this is the name you are using for the graphic resource). In the rules editor are you inserting the Field Names or typing them in? Inserting them will keep typographical errors from occuring. Don't know if this will help or not, but it is worth a shot. Link to comment Share on other sites More sharing options...
Dan Korn Posted October 16, 2009 Share Posted October 16, 2009 This is close: return Field("FirstName") + " " + Field("LastName") + " " + Resource("Korean Graphic");But you need to use the content property to return the actual <graphic> tag which will invoke the inline graphic: return Field("FirstName") + " " + Field("LastName") + " " + Resource("Korean Graphic").content;Obviously you will also need to check the "Treat returned strings as tagged text" box. In order to avoid any problems with special characters in your field values with such a rule, I recommend using the TaggedTextFromRaw function, like so: return TaggedTextFromRaw(Field("FirstName") + " " + Field("LastName") + " ") + Resource("Korean Graphic").content; Also, there's nothing at all wrong with having spaces in your resource names, or with adding extra parentheses around any JavaScript expression. Link to comment Share on other sites More sharing options...
Tony Olivas Posted October 16, 2009 Author Share Posted October 16, 2009 Dan, That did it. Thanks guys!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.