我正在设置一个从CSV文件中读取的邮件合并文件。在CSV文件中,有大约20个布尔字段,用于生成Word邮件合并文件的正文。问题是,如果前19个字段都是"N"
,那么Word邮件合并文件将有19个空格,然后输出所有这些字段下面的第20个字段。有没有办法使用内置的邮件合并规则来抑制这些空白行的输出?
"firstname","lastname","PRNT1040","LEGALGRD","ACADTRAN","STUD1040","VERWKSIN","VERWKSDP","UNEMPLOY","SSCARD","HSDPLOMA","DPBRTCFT","DEATHCRT","USCTZPRF","SLCTSERV","PROJINCM","YTDINCM","LAYOFFNT","MAJRCARS","W2FATHER","W2MOTHER","W2SPOUSE","W2STUDNT","2YRDEGRE","4YEARDEG","DPOVERRD"
"Joe","Smith","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","Y"
这是我正在尝试的几行邮件合并文件(图像链接,因为复制和粘贴邮件合并不显示原始文档)
<小时/> 有谁知道怎么解决这个问题?我尝试将
SKIPIF
置于条件之前,但这也不起作用。
答案 0 :(得分:1)
以下条件IF字段将消除由空的中间初始字段引起的空格:
{FNAME} {IF {MI} <> "" "{MI} "}{LNAME}
以下条件MERGEFIELD字段将删除任何字段中的空格。例如,给定以下字段,
{Prefix} {FirstName} {LastName}
以下条件语句将正确地抑制通常包含在任何空白字段中的空间:
{IF {MERGEFIELD Prefix}<>"" "{MERGEFIELD Prefix} "}
{IF {MERGEFIELD FirstName}<>"" "{MERGEFIELD FirstName} "}
{IF {MERGEFIELD LastName}<>"" "{MERGEFIELD LastName}"}
要输入字段字符({}),请从“插入”菜单中选择“字段”(或按CTRL + F9)。
注意:您是通过从informix卸载数据并用逗号替换管道分隔符来创建csv吗?...也许最好创建一个可以更好地操作字符串来创建csv文件的ace报告!这是我用来实现类似目标的王牌报告的一个例子:
database pawnshop end
define
variable act integer
variable actven integer
variable ret integer
variable ven integer
variable cmp integer
variable plt integer
variable vta integer
variable tot integer
variable totprof integer
end
output
top margin 0
bottom margin 0
left margin 0
right margin 384
report to "clientes.unl"
page length 200000
end
select
pa_serial,
pa_code,
pa_store_id,
pa_user_id,
pa_cust_name,
pa_id_type,
pa_id_no,
pa_dob,
pa_address1,
pa_city,
pa_tel,
pa_cmt,
pa_entry_date,
pa_last_date,
pa_idioma,
pa_apodo,
pwd_id,
pwd_trx_type,
pwd_last_type,
pwd_last_pymt,
pwd_trx_date,
pwd_pawn_amt,
pwd_last_amt,
pwd_cob1,
pwd_cob2,
pwd_cob3,
pwd_cob4,
pwd_update_flag,
st_code,
st_exp_days,
st_com_exp,
st_plat_exp
from CLIENTES, outer BOLETOS, storetab
where pa_serial = pwd_id
and pa_code = st_code
order by pa_cust_name, pwd_last_pymt
end
format
on every row
if pwd_last_type = "E" then
begin
let act = act + 1
if today - pwd_last_pymt >= st_exp_days then
let actven = actven + 1
end
if pwd_last_type = "I" then
begin
let act = act + 1
if today - pwd_last_pymt >= st_exp_days then
let actven = actven + 1
end
if pwd_trx_type = "C" then
begin
let cmp = cmp + 1
if pwd_last_type = "C" and (today - pwd_last_pymt >= st_com_exp) then
let actven = actven + 1
end
if pwd_last_type = "R" then
begin
let ret = ret + 1
end
if pwd_trx_type = "P" and pwd_last_type = "P" then
begin
let plt = plt + 1
if today - pwd_last_pymt >= st_plat_exp then
let actven = actven + 1
end
if pwd_trx_type = "E" and pwd_last_type = "F" then
begin
let ven = ven + 1
end
if pwd_trx_type = "P" and pwd_last_type = "F" then
begin
let ven = ven + 1
end
if pwd_trx_type = "E" and pwd_last_type = "T" then
begin
let ven = ven + 1
end
if pwd_trx_type = "P" and pwd_last_type = "T" then
begin
let ven = ven + 1
end
before group of pa_cust_name
let totprof = 0
let tot = 0
let act = 0
let actven = 0
let ret = 0
let ven = 0
let cmp = 0
let plt = 0
let vta = 0
after group of pa_cust_name
print column 1, pa_serial using "<<<<<","|",
pa_code clipped,"|",
pa_store_id clipped,"|",
pa_user_id clipped,"|",
pa_cust_name clipped,"|",
pa_id_type clipped,"|",
pa_id_no clipped,"|",
pa_dob using "mm-dd-yyyy","|",
pa_address1 clipped,"|",
pa_city clipped,"|",
pa_tel clipped,"|",
pa_cmt clipped,"|",
pa_entry_date using "mm-dd-yyyy","|",
pwd_last_pymt using "mm-dd-yyyy","|",
act using "&&&","|",
ret using "&&&","|",
ven using "&&&","|",
tot using "&&&","|",
totprof using "-&&&&&","|",
actven using "&&&","|",
cmp using "&&&","|",
pa_idioma,"|",
pa_apodo,"|",
plt using "&&&","|",
vta using "&&&","|"
end
答案 1 :(得分:1)
简单的做法就是跳过你的IF条件中的'false'部分。
写下真实的部分
IF MERGEFIELD = "Y" "true section"
当你包含虚假部分时,它会(我认为)考虑到
答案 2 :(得分:0)
我们通过更改行来解决问题:
{ IF { MERGEFIELD PRNT1040} = "Y" "Write some text, then use a return line here
" "" }
然后我们将这些规则背靠背放置,而不是在对话框内的每个规则之后放置换行符 - 出于某种原因,Word在完成IF之后解析掉换行符 - &gt;然后 - &gt; ELSE规则包含在word的邮件合并选项中。