Foxtable(狐表)用户栏目专家坐堂 → 导出


  共有7119人关注过本帖树形打印复制链接

主题:导出

帅哥哟,离线,有人找我吗?
有点蓝
  31楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/12/24 17:03:00 [只看该作者]

不包含扩展名
If e.Book.TempLate = "111" Then

另外确定有"图片1""图片2"这个列名?

 回到顶部
帅哥哟,离线,有人找我吗?
aaa1234
  32楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:825 积分:1650 威望:0 精华:0 注册:2021/7/30 8:48:00
  发帖心情 Post By:2021/12/25 8:45:00 [只看该作者]

If e.Book.TempLate = "111" Then
    If e.region = "table_3" Then
Dim ftp1 As new ftpclient
ftp1.host="172.16.120.41"
ftp1.Account = "admin"
ftp1.password = "qw123"
If ftp1.Download(e.DataRow("图片"),"c:\data\Desert.jpg") = True Then
Dim file As String = "c:\data\Desert.jpg"
Dim img As image = getImage(file)
Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))
bmp.save(ProjectPath & "Images\图片1.jpg")
bmp.Dispose
End If

If ftp1.Download(e.DataRow("图片"),"c:\data\Desert2.jpg") = True Then
Dim file As String = "c:\data\Desert2.jpg"
Dim img As image = getImage(file)
Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))
bmp.save(ProjectPath & "Images\图片2.jpg")
bmp.Dispose
End If
    End If
End If 老师这样写就是空的他也插入了缩略图,还有一个就是图片1跟图片2是一模一样的

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  33楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/12/25 8:53:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
aaa1234
  34楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:825 积分:1650 威望:0 精华:0 注册:2021/7/30 8:48:00
  发帖心情 Post By:2021/12/25 9:03:00 [只看该作者]

If e.Book.TempLate = "111" Then
    If e.region = "table_3" Then
Dim ftp1 As new ftpclient
ftp1.host="172.16.120.41"
ftp1.Account = "admin"
ftp1.password = "qw123"
If DataTables("table_3").DataRows().IsNull("图片"Then
If ftp1.Download(e.DataRow("图片"),"c:\data\Desert.jpg") = True Then
Dim file As String = "c:\data\Desert.jpg"
Dim img As image = getImage(file)
Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))
bmp.save(ProjectPath & "Images\图片1.jpg")
bmp.Dispose
End If
end if 
If ftp1.Download(e.DataRow("图片"),"c:\data\Desert2.jpg") = True Then
Dim file As String = "c:\data\Desert2.jpg"
Dim img As image = getImage(file)
Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))
bmp.save(ProjectPath & "Images\图片2.jpg")
bmp.Dispose
End If
    End If
End If
获取图片列多个文件:http://www.foxtable.com/webhelp/topics/2717.htm 老师这个看的不是很懂应该怎么做

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  35楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/12/25 9:09:00 [只看该作者]

看看帮助是怎么在表事件里判断空值的:http://www.foxtable.com/webhelp/topics/0625.htm,都是一些很基础的语法,建议还是多看看http://www.foxtable.com/webhelp/topics/1592.htm

什么地方看不懂?

 回到顶部
帅哥哟,离线,有人找我吗?
aaa1234
  36楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:825 积分:1650 威望:0 精华:0 注册:2021/7/30 8:48:00
  发帖心情 Post By:2021/12/25 9:17:00 [只看该作者]

If e.Book.TempLate = "111" Then
    If e.region = "table_3" Then
Dim ftp1 As new ftpclient
ftp1.host="172.16.120.41"
ftp1.Account = "admin"
ftp1.password = "qw123"
 '如果更改的是身份证号码列
If e.DataRow.IsNull("图片") Then '身份证号码是否为空
Else
If ftp1.Download(e.DataRow("图片"),"c:\data\Desert.jpg") = True Then
Dim file As String = "c:\data\Desert.jpg"
Dim img As image = getImage(file)
Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))
bmp.save(ProjectPath & "Images\图片1.jpg")
bmp.Dispose
End If
End If 
If e.DataRow.IsNull("图片") Then '身份证号码是否为空
Else
If ftp1.Download(e.DataRow("图片"),"c:\data\Desert2.jpg") = True Then
Dim file As String = "c:\data\Desert2.jpg"
Dim img As image = getImage(file)
Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))
bmp.save(ProjectPath & "Images\图片2.jpg")
bmp.Dispose
End If
End If
    End If
End If
那判断为空应该是这样吧,老师我不懂的是获取图片列多个文件:http://www.foxtable.com/webhelp/topics/2717.htm 这个,怎么将图片列的值拿出两张图片来

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  37楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/12/25 9:29:00 [只看该作者]

If e.DataRow.IsNull("图片") = false Then '身份证号码是否为空
Dim fls As List(of String) = e.DataRow.Lines("图片")
for i as integer = 0 to fls.count - 1
dim file as string = "c:\data\Desert" & i & ".jpg"
If ftp1.Download(fls(i),file) = True Then
Dim img As image = getImage(file)
Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))
bmp.save(ProjectPath & "Images\图片" & (i+1) & ".jpg")
bmp.Dispose
next
End If 

 回到顶部
帅哥哟,离线,有人找我吗?
aaa1234
  38楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:825 积分:1650 威望:0 精华:0 注册:2021/7/30 8:48:00
  发帖心情 Post By:2021/12/25 9:45:00 [只看该作者]

If e.Book.TempLate = "111" Then
    If e.region = "table_3" Then
Dim ftp1 As new ftpclient
ftp1.host="172.16.120.41"
ftp1.Account = "admin"
ftp1.password = "qw123"
If e.DataRow.IsNull("图片") = False Then '身份证号码是否为空
Dim fls As List(of String) = e.DataRow.Lines("图片")
For i As Integer = 0 To fls.count - 1
Dim file As String = "c:\data\Desert" & i & ".jpg"
If ftp1.Download(fls(i),file) = True Then
Dim img As image = getImage(file)
Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))
bmp.save(ProjectPath & "Images\图片" & i+1 & ".jpg")
bmp.Dispose
Next
End If 
End If
End If
他说我编译错误

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  39楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107135 积分:544918 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/12/25 9:51:00 [只看该作者]

把项目文件复制到其它目录打开,注意项目文件所在的路径不能有括号等特殊符号。然后就可以看到具体的错误提示了

 回到顶部
帅哥哟,离线,有人找我吗?
aaa1234
  40楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:825 积分:1650 威望:0 精华:0 注册:2021/7/30 8:48:00
  发帖心情 Post By:2021/12/25 10:05:00 [只看该作者]

替换有多个图片的,可以使用
[&&图片1.jpg,2,2,60,20]
[&&图片2.jpg,2,2,60,20]

最后将BuildDetail事件代码设置为:

If e.Book.TempLate = "111" Then

    If e.region = "table_3" Then

Dim ftp1 As new ftpclient

ftp1.host="172.16.120.41"

ftp1.Account = "admin"

ftp1.password = "qw123"

If e.DataRow.IsNull("图片") = False Then '身份证号码是否为空

Dim fls As List(of String) = e.DataRow.Lines("图片")

For i As Integer = 0 To fls.count - 1

Dim file As String = "c:\data\Desert" & i & ".jpg"

If ftp1.Download(fls(i),file) = True Then

Dim img As image = getImage(file)

Dim bmp As new bitmap(img, 100, 100 * (img.height / img.width))

bmp.save(ProjectPath & "Images\图片" & i+1 & ".jpg")

bmp.Dispose

End If 

Next

End If 

End If

End If 老师还是一样该空的没有空到,空的都填错上一条的两张图片


 回到顶部
总数 87 上一页 1 2 3 4 5 6 7 8 9 下一页