以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 只要勾选的记录  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=164916)

--  作者:sanny
--  发布时间:2021/5/8 16:57:00
--  [求助] 只要勾选的记录

老师,如何将以下改成 如图中只要列 FUsed 勾选中的记录转到Excel中,谢谢。

Dim Book As New XLS.Book(ProjectPath & "Attachments\\Manuf_Incoming.xlsx")

Dim Result As DialogResult
Dim Proc As New Process 
Dim fl As String = ProjectPath & "WH\\" & Tables("Incoming").current("Barcode") & ".xlsx"
Book.Build()

If FileS ys.FileExists(ProjectPath & "WH\\" & Tables("Incoming").current("Barcode") & ".xlsx")  Then
    Result = Messagebox.Show(Tables("Incoming").current("Barcode") & ".xlsx"&" 文件已经存在,是否要覆盖?","提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
    If Result = DialogResult.Yes Then
        
        Book.Save(fl) 
        Proc.File = fl
        Proc.Start()



图片点击可在新窗口打开查看此主题相关图片如下:捕获.png
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2021/5/8 17:06:00
--  
参考:http://www.foxtable.com/webhelp/topics/0201.htm


--  作者:sanny
--  发布时间:2021/5/8 18:35:00
--  
谢谢,老师 ,这个方法可。不过可以帮忙加在以上代码中,另外需满足勾选的记录中,其中 列 PartNo 和PartDesc 的都相同才可转到Excel,否则提示“所选记录有不同内容”,这个有点难,谢谢。
--  作者:有点蓝
--  发布时间:2021/5/9 20:53:00
--  
dim dr as datarow = datatables("xx表").find("FUsed=true")
if dr is nothing then
msgbox("无选择")
else
if datatables("xx表").compute("count(PartNo)","FUsed=true and (PartNo <> \'" & dr("PartNo") & "\' or PartDesc  <> \'" & dr("PartDesc") & "\')") > 0 then
msgbox("所选记录有不同内容")
return
end if
end if
接着打印代码
[此贴子已经被作者于2021/5/9 20:53:29编辑过]

--  作者:sanny
--  发布时间:2021/5/9 22:32:00
--  
谢谢老师,

提醒是正确的,如果选择不同的记录。

但是记录正确选好后,打出来的记录不对,它只打印光标指向的当前记录,对于勾选的记录不起作用。

--  作者:有点蓝
--  发布时间:2021/5/9 22:44:00
--  
没有指定条件,看2楼