Kal Posted August 15, 2013 Share Posted August 15, 2013 I have 6 lines of variables and all are being tabbed and then the variable. When one of the line is empty it won't suppress that line, it's still seeing the tab. How do I get around this? Example: Static Header:TAB..Variable Line1 TAB......................Variable Line2 TAB...................... TAB......................Variable Line4 TAB...................... TAB......................Variable Line6 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 15, 2013 Share Posted August 15, 2013 You can change from "Suppress if Empty" to "Suppress if Containing Empty Variables." Or, you could output all the text in a JavaScript rule, with logic to skip the empty lines there. Quote Link to comment Share on other sites More sharing options...
Kal Posted August 15, 2013 Author Share Posted August 15, 2013 Can I get an example of a JavaScript rule with Tabs and skip empty lines? Maybe using my example in the Script? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 15, 2013 Share Posted August 15, 2013 Can I get an example of a JavaScript rule with Tabs and skip empty lines? Maybe using my example in the Script? Does switching to "Suppress if Containing Empty Variables" not work for you? Anyway, your example doesn't say what your actual variable field names are, but you could do something like this: var result = []; for (var i = 1; i <= 6, i++) { var line = Field("SomeNameHere" + i) if (line) result.push("<t>" + line); } return result.join("<br>\n"); Quote Link to comment Share on other sites More sharing options...
Kal Posted August 16, 2013 Author Share Posted August 16, 2013 "Suppress if Containing Empty Variables" works but it suppress all the 6 variable lines, even the ones that are not empty. Why would it do this? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 16, 2013 Share Posted August 16, 2013 "Suppress if Containing Empty Variables" works but it suppress all the 6 variable lines, even the ones that are not empty. Why would it do this? I'm not sure. Are you using "soft returns" instead of hard paragraph breaks? Quote Link to comment Share on other sites More sharing options...
Kal Posted August 16, 2013 Author Share Posted August 16, 2013 Dan I made a test file for you. Let me know what I'm doing wrong. Thanks.130772_TEST.zip Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted August 16, 2013 Share Posted August 16, 2013 Dan I made a test file for you. Let me know what I'm doing wrong. Thanks. What you're doing wrong is that you haven't actually set those lines to "Suppress if Containing Empty Variables." They're all still set to "Suppress if Empty." Remember that the settings in the Paragraph Formatting dialog affect only the currently selected paragraph(s), so if you just have the cursor set somewhere randomly in the text frame and open the Paragraph Formatting, whatever you change in there is not going to affect the entirety of the text, unless you have all the text selected. So I think the easiest way to do what you want is to open up the text frame, select all the text (with Ctrl-A), then click the Paragraph button, change the setting in the "Suppress if" drop-down list to "Containing Empty Variables," then click OK, and OK again. That's what I did, and now the other paragraph "floats up." Also, you have multiple borrowers' names straddling different lines. You probably want to keep each borrower's first and last named together on the same line, separate from other borrowers' names, like so in the Text Editor: Borrower(s): «PD_BORROWER1_NAME1» «PD_BORROWER1_NAME2» «PD_BORROWER2_NAME1» «PD_BORROWER2_NAME2» «PD_BORROWER3_NAME1» «PD_BORROWER3_NAME2» «PD_BORROWER4_NAME1» «PD_BORROWER4_NAME2» «PD_BORROWER5_NAME1» «PD_BORROWER5_NAME2» «PD_BORROWER6_NAME1» «PD_BORROWER6_NAME2» «PD_BORROWER7_NAME1» «PD_BORROWER7_NAME2» «PD_BORROWER8_NAME1» «PD_BORROWER8_NAME2» «PD_BORROWER9_NAME1» «PD_BORROWER9_NAME2» This can all also be done easily enough in JavaScript, like so: var result = []; for (var i = 1; i <= 6; i++) { var line = Field("PD_BORROWER" + i + "_NAME1") + " " + Field("PD_BORROWER" + i + "_NAME2"); if (Trim(line)) result.push("<t>" + line); } return result.join("<br>\n"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.