以文本方式查看主题

-  易表在线答疑  (http://egrid2000.com/dvbbs/index.asp)
--  用户社区  (http://egrid2000.com/dvbbs/list.asp?boardid=2)
----  请求帮助-自定义打印按钮  (http://egrid2000.com/dvbbs/dispbbs.asp?boardid=2&id=25756)

--  作者:redpin
--  发布时间:2013/6/22 11:05:00
--  请求帮助-自定义打印按钮

这是一个自定义按钮的公式,点击按钮不执行相关操作,请求各位看看下面公式错在哪里:

 

CopyFor("备款单","用户索引号","用户索引号","B","=","0","A", "=" ,[%A%],"收与否","=","0") And

--------将当前表中符合条件的行的"用户索引号"复制到表"备款单"中

 

DelReptRows("备款单","用户索引号") And

--------删除表"备款单"中"用户索引号"重复的行

 

SetVariable("%打印页%",CountFor("备款单","B", "=" ,"0")) And

--------统计表"备款单"中待打印的行数

Loop("[B] = 0","Move(1,5) And SetVariable(""%索引号%"",FindText(""备款单"",""用户索引号"",""B"", ""="" ,"""")) And

FilterFor(""用户索引号"", ""="" ,[%索引号%],""B"",""="",""0"",""收与否"",""="",""0"") And

Report(""水费计算"",""水电费备款通知单1"",1,Rows,1) And

ReplaceFor(""备款单"",""B"", -1,""用户索引号"", ""="" ,[%索引号%]) And

DelFor(""备款单"",""B"", ""="" ,-1) And ShowAllRows() And

SetVariable(""%索引号%"","""")",Number([%打印页%]))

--------执行循环


--  作者:dancedy
--  发布时间:2013/6/22 11:44:00
--  

以上公式逐条执行,看看问题出现在哪个公式

传文件看看

[此贴子已经被作者于2013-6-22 12:02:10编辑过]

--  作者:redpin
--  发布时间:2013/6/22 17:09:00
--  

CopyFor("备款单","用户索引号","用户索引号","B","=","0","A", "=" ,[%A%],"收与否","=","0") And
DelReptRows("备款单","用户索引号") And

SetVariable("%打印页%",CountFor("备款单","B", "=" ,"0")) And

Loop("[B] = 0","SetVariable(""%索引号%"",FindText(""备款单"",""用户索引号"",""B"", ""="" ,""0"")) And

FilterFor(""用户索引号"", ""="" ,[%索引号%],""B"",""="",""0"",""收与否"",""="",""0"") And

Report(""水费计算"",""水电费备款通知单1"",1,Rows,1) And

ReplaceFor(""备款单"",""B"", -1,""用户索引号"", ""="" ,[%索引号%]) And

DelFor(""备款单"",""B"", ""="" ,-1) And

SetVariable(""%索引号%"","""") And ShowAllRows()",Number([%打印页%]))

 

去掉循环可以打印,加入循环就没反应了


--  作者:redpin
--  发布时间:2013/6/24 22:17:00
--  
是不是问题出在这里:"[B] = 0" ?[B]是一逻辑列
--  作者:wjq1072
--  发布时间:2013/6/25 6:50:00
--  

试试?

Loop("1>0","SetVariable(""%索引号%"",FindText(""备款单"",""用户索引号"",""B"", ""="" ,""0"")) And

FilterFor(""用户索引号"", ""="" ,[%索引号%],""B"",""="",""0"",""收与否"",""="",""0"") And

Report(""水费计算"",""水电费备款通知单1"",1,Rows,1) And

ReplaceFor(""备款单"",""B"", -1,""用户索引号"", ""="" ,[%索引号%]) And

DelFor(""备款单"",""B"", ""="" ,-1) And

SetVariable(""%索引号%"","""") And ShowAllRows()",20)