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

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 18th, 2011, 07:57 AM
Matt Centa Matt Centa is offline
Junior Community Member
 
Join Date: Feb 2011
Location: Austin, TX
Posts: 14
Default Empty field only suppress one way

I have a business card that has 4 lines of information. The first line is all static information. The second line contains the address city and zip info. The third line has there phone and fax info. the forth line is static email.
I have set up these variable to suppress with empty fields. My problem is when only the address information is filled out it leaves that line with an empty space and doesn't suppress that line. It does suppress when they have just there phone and fax info filled out. strange to me. any suggestions on how to fix this would be great.

I'm using a Mac 10.5.8
Acrobat 9.4.1
FusionPro 7.1P1c
Reply With Quote
  #2  
Old March 30th, 2011, 12:01 PM
FreightTrain's Avatar
FreightTrain FreightTrain is offline
Learning Development Manager
 
Join Date: Oct 2008
Location: Solana Beach, CA
Posts: 326
Default Re: Empty field only suppress one way

Matt,
I'm not sure I see where the Problem is, Suppress if Empty is applied to an entire Paragraph, which in this case is a Line. Line 1 and Line 4 are static so I will ignore those. You said Line 2 contains the <<Address>>, <<City>> and <<Zip>>. Line 3 contains the <<Phone>> and <<Fax>>. Your problem as stated was
"when only the address information is filled out it leaves that line with an empty space and doesn't suppress that line"
So I'm guessing that means that when they do not have <<City>> or <<Zip>> info, you are getting the <<Address>> suppressed, and you still want the <<City>> and/or <<Zip>> to show? If this is the case you can define an append text function in your JS Globals and then create a rule to complete the line.

This function is inserted into JavaScript Globals:
/*
FullText, Delimiter & NewText are the parameters for the funtion
that have yet to be determined. Where NewText will eventually be
the field value from the data and FullText will be the string created
with what ever Delimiter (separator) we define.
*/

function AppendText(FullText, Delimiter, NewText)

{
if (NewText != "")
{
if (FullText != "")
FullText += Delimiter; //+= is an addition assignment take FullText and add the delimiter

FullText += NewText; //now FullText is the string plus the delimiter += NewText
}

return FullText;
}


This info is in a Text Rule:

/*
var s represents the new CSZ string that the function will be creating in JS Globals
where s is FullText -> function AppendText(FullText, Delimiter, NewText)
*/

var s = "";

s = AppendText(s, " ", Field("Address")); //s is now 1234 Main Street after function runs (record 1)
s = AppendText(s, ", ", Field("City")); //s is now 1234 Main Street, Mohilef after function runs (record 1)
s = AppendText(s, " ", Field("Zip")); //s is now 1234 Main Street, Mohilef 78966 after function runs (record 1)


return s; //s is now 1234 Main Street, Mohilef 78966 after function runs (record 1)


Hope this helps!
__________________
Richard A. Lewis, Jr.
Learning Development Manager | MarcomCentral® a Ricoh Company
Reply With Quote
Reply

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 03:17 AM.


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