Jump to content

Empty field only suppress one way


Matt Centa

Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...

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!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...