Jump to content

Need to keep formated but also "supress if empty" - moving text upwards.


methogod

Recommended Posts


return ((Field ("issue_date")+"<t><t>"+Field("check_number")+"<t><t>"+Field("check_amount")+"<br>"+
Field ("issue_date2")+"<t><t>"+Field("check_number2")+"<t><t>"+Field("check_amount2")+"<br>"
+Field ("issue_date3")+"<t><t>"+Field("check_number3")+"<t><t>"+Field("check_amount3")+"<br>"
+Field ("issue_date4")+"<t><t>"+Field("check_number4")+"<t><t>"+Field("check_amount4")+"<br>"
+Field ("issue_date5")+"<t><t>"+Field("check_number5")+"<t><t>"+Field("check_amount5")+"<br>"
+Field ("issue_date6")+"<t><t>"+Field("check_number6")+"<t><t>"+Field("check_amount6")+"<br>"
+Field ("issue_date7")+"<t><t>"+Field("check_number7")+"<t><t>"+Field("check_amount7")+"<br>"
+Field ("issue_date8")+"<t><t>"+Field("check_number8")+"<t><t>"+Field("check_amount8")+"<br>"
+Field ("issue_date9")+"<t><t>"+Field("check_number9")+"<t><t>"+Field("check_amount9")+"<br>"
+Field ("issue_date10")+"<t><t>"+Field("check_number10")+"<t><t>"+Field("check_amount10")+"<br>"
+Field ("issue_date11")+"<t><t>"+Field("check_number11")+"<t><t>"+Field("check_amount11")))

 

Suppress if empty doesn't work nor does suppress if empty variable

tried it as CODE but that rule wants to consider TABS <t> as NON EMPTY...

 

whats an easy solution?

 

Link to comment
Share on other sites

Hi, the issue is that the <br> tag makes a new line in the same paragraph. Skip if empty only skips the whole paragraph, so it won't skip just a line. But I think you want this:

 

var retstr="";
for (i=1;i<=11;i++)
{
  if (Len(Trim(Field("issue_date"+i))) > 0 && Len(Trim(Field("check_number"+i))) > 0 && Len(Trim(Field("check_amount"+i))) > 0)
    retstr += Field ("issue_date"+i)+"<t><t>"+Field("check_number"+i)+"<t><t>"+Field("check_amount"+i)+"<br>"
}
return retstr;

I think that will work. I can't test this since I don't have your fields, and hopefully the parentheses match up.  This will skip if any of issue_date or check_number or check_amount are empty. If you only want to skip if all of them are empty change the && to || above.
 

  • Like 1
Link to comment
Share on other sites

Yes, replace this line:

retstr += Field ("issue_date"+i)+"<t><t>"+Field("check_number"+i)+"<t><t>"+Field("check_amount"+i)+"<br>"

with this:

retstr += Field ("issue_date"+i)+"<t><t>"+Field("check_number"+i)+"<t><t>"+FormatNumber("$###,###.00", Field("check_amount"+i))+"<br>";

That will put in leading dollar signs, commas at the thousands place and force two zeros after the decimal.

 

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...