Jump to content

Tabbed Lists


bdgreene88

Recommended Posts

Thanks in advance for your help!

 

I need to create a tabbed list within the body of a letter. All the lists are all variable. It would look like the following:

 

<improve_1>TAB<improve_2>

<improve_3>TAB<improve_4>

<improve_5>TAB<improve_6>

<improve_7>TAB<improve_8>

<improve_9>TAB<improve_10>

<improve_11>TAB<improve_12>

<improve_13>TAB<improve_14>

<improve_15>TAB<improve_16>

<improve_18>TAB<improve_18>

 

Not all of the variables are used. Some just have just 1, others have all 18. The body of the letter will need to flow with the tabbed list.

 

My problem is when I use "suppress if containing empty variables", it removes the entire line if just one of the variables are empty.

 

Any advice you can give would be GREATLY appreciated.

 

Thank you!

Link to comment
Share on other sites

bdgreene

I'm just a hack when it comes to javascript but you can make rules for each line. You don't have to select anything and suppress it.

 

//Rule for improve_1 and improve_2 line

if ((Field("improve_1") != "") && (Field("improve_2") != ""))

return Field("improve_1") + '<t>' + Field("improve_2");

 

else if ((Field("improve_1") != "") || (Field("improve_2") != ""))

return Field("improve_1") + Field("improve_2");

 

else

return "";

Link to comment
Share on other sites

You can make a rule to return them all with the appropriate formatting:

fields = [];
i = 0;
while (i < 18) {
   r=[];
   while (r.length<2 && i<18)
       if (a = Field('improve_' + ++i)) r.push(a);
   fields.push(r.join('<t>\t'));
}
return fields.join('<br>\n')

Make sure that that "Treat returned strings as tagged text" is checked.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...