Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 6th, 2012, 09:49 AM
BuffaloPrintingCo BuffaloPrintingCo is offline
Junior Community Member
 
Join Date: Sep 2011
Location: Kenmore, NY, USA
Posts: 11
Question Bullet points to show up when previewing

I have the java code below:

return Field("Address 1")+' '+'•'+' '+Field("City State Zip 1")+' '+'•'+' '+Field("Phone 1");

Fields Address 1, City State Zip 1, and Phone 1 all exist and it's supposed to put a space then a bullet then another space between the three fields. When it previews, it actually put the text  •  in there instead of the actual characters.

What am I missing?
__________________
Joe Farage Jr.
IT Manager
Buffalo Printing Co.

JoeJr@BuffaloPrinting.com
Reply With Quote
  #2  
Old April 6th, 2012, 10:33 AM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 213
Default Re: Bullet points to show up when previewing

Check the box in the upper right of the rule window that says "Treat returned strings as tagged text".
Reply With Quote
  #3  
Old April 6th, 2012, 11:14 AM
BuffaloPrintingCo BuffaloPrintingCo is offline
Junior Community Member
 
Join Date: Sep 2011
Location: Kenmore, NY, USA
Posts: 11
Default Re: Bullet points to show up when previewing

Great! thanks,
that got the actual characters to show up but now my issue is this.
I have 4 lines of this code with Address 1, Address 2, etc etc and not all the fields always get filled in.
How can I make it so that the symbols disappear when there is no variable field filled in?
__________________
Joe Farage Jr.
IT Manager
Buffalo Printing Co.

JoeJr@BuffaloPrinting.com
Reply With Quote
  #4  
Old April 6th, 2012, 11:21 AM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 213
Default Re: Bullet points to show up when previewing

Here's an example of one way it could be done:

Code:
var addr1 = Field("Address 1");
var addr2 = Field("Address 2");
var spacer = " • ";

if (addr1.length > 0)
	addr1 += spacer;
	
if (addr2.length > 0)
	addr2 += spacer;

return addr1 + addr2 + Field("City State Zip 1") + spacer + Field("Phone 1");
It checks the string length of the value for those fields. If there is more than 0 characters, it appends the spacer string.
Reply With Quote
  #5  
Old April 6th, 2012, 11:47 AM
BuffaloPrintingCo BuffaloPrintingCo is offline
Junior Community Member
 
Join Date: Sep 2011
Location: Kenmore, NY, USA
Posts: 11
Default Re: Bullet points to show up when previewing

Awesome! With a couple tweaks I was able to make it work perfectly for our application of it.

Thanks a lot Thomas! Definately got this taken care of a lot faster than i expected.
Happy Easter!

J
__________________
Joe Farage Jr.
IT Manager
Buffalo Printing Co.

JoeJr@BuffaloPrinting.com
Reply With Quote
Reply

Tags
ansi, bullet points, concatenation, java, join

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:12 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.