此主题相关图片如下:提问图片.jpg
Dim tbl As WinF orm.Table
Dim filters As String = "合同号 = '" & e.Fo rm.Controls("合同号").Text & "'And 款号 = '" & e.Fo rm.Controls("款号").Text & "' And 业务担当 = '" & e.Fo rm.Controls("业务担当").Text & "' And 合同交期 = '" & e.Fo rm.Controls("合同交期").Text & "' And 客户名称 = '" & e.Fo rm.Controls("客户名称").Text & "' And 品名 = '" & e.Fo rm.Controls("品名").Text & "'"
tbl = e.Fo rm.CreateSQLTable("订单主表", "Select * fr om {订单主表} where " & filters,"彬阳数据")
tbl.SetBounds(10, 10, 600, 400)
tbl.Visible = False
e.Fo rm.AddControl(tbl)
MessageBox.Show("1")
Dim r As Row = Tables("订单主表_订单主表").Current
MessageBox.Show("2")
Dim Book As New XLS.Book(ProjectPath & "Attachments\订单表.xls") '打开模板
MessageBox.Show("3")
Dim fl As String = "d:/订单信息/" + (r("客户名称")) + "/" + (r("合同号")) + "- " + (r("款号")) + " 订单指示.xls"
MessageBox.Show("4")
DataTables("订单主表_订单主表").DataCols("款式图片").ExtendType = ExtendTypeEnum.Images
MessageBox.Show("5")
DataTables("订单主表_订单主表").DataCols("款式图片").FileFilter = "图形文件|bmp;*.jpg;*.gif"
MessageBox.Show("6")
DataTables("订单主表_订单主表").DataCols("款式图片").ExtendType = ExtendTypeEnum.FILES
MessageBox.Show("7")
DataTables("订单主表_订单主表").DataCols("款式图片").Remote = True
MessageBox.Show("8")
DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.Host = Tables("FTPIP").Current("FTPhost")
MessageBox.Show("9")
DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.Account = Tables("FTPIP").Current("FTPAccount")
MessageBox.Show("10")
DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.password = Tables("FTPIP").Current("FTPpassword")
MessageBox.Show("11")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
MessageBox.Show("12")
Book.Build() '生成报表 这里跳出提示
MessageBox.Show("13")
Book.Save(fl)
不用使用CreateSQLTable,使用AddDataTable这种方式:http://www.foxtable.com/webhelp/topics/3233.htm
Dim filters As String = "合同号 = '" & e.Form.Controls("合同号").Text & "'And 款号 = '" & e.Form.Controls("款号").Text & "' And 业务担当 = '" & e.Form.Controls("业务担当").Text & "' And 合同交期 = '" & e.Form.Controls("合同交期").Text & "' And 客户名称 = '" & e.Form.Controls("客户名称").Text & "' And 品名 = '" & e.Form.Controls("品名").Text & "'"
Dim Book As New XLS.Book(ProjectPath & "Attachments\订单表.xls") '打开模板
Dim fl As String = "d:/订单信息/" & e.Form.Controls("客户名称").Text & "/" & e.Form.Controls("合同号").Text & "- " & e.Form.Controls("款号").Text & " 订单指示.xls"
book.AddDataTable("订单主表_订单主表", "彬阳数据", "Select * fr om {订单主表} where " & filters)
book.DataTables("订单主表_订单主表").DataCols("款式图片").ExtendType = ExtendTypeEnum.Images
book.DataTables("订单主表_订单主表").DataCols("款式图片").FileFilter = "图形文件|bmp;*.jpg;*.gif"
book.DataTables("订单主表_订单主表").DataCols("款式图片").ExtendType = ExtendTypeEnum.FILES
book.DataTables("订单主表_订单主表").DataCols("款式图片").Remote = True
book.DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.Host = Tables("FTPIP").Current("FTPhost")
book.DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.Account = Tables("FTPIP").Current("FTPAccount")
book.DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.password = Tables("FTPIP").Current("FTPpassword")
Book.Build() '生成报表 这里跳出提示
Book.Save(fl)
Dim fl As String = "d:/订单信息/" & e.F orm.Controls("客户名称").Text & "/" & e.F orm.Controls("合同号").Text & "- " & e.F orm.Controls("款号").Text & " 订单指示.xls"
MessageBox.Show("1")
book.AddDataTable("订单主表_订单主表", "彬阳数据", "Select * f rom {订单主表} where " & filters)
MessageBox.Show("2")
book.DataTables("订单主表_订单主表").DataCols("款式图片").ExtendType = ExtendTypeEnum.Images
MessageBox.Show("3")
book.DataTables("订单主表_订单主表").DataCols("款式图片").FileFilter = "图形文件|bmp;*.jpg;*.gif"
MessageBox.Show("4")
book.DataTables("订单主表_订单主表").DataCols("款式图片").ExtendType = ExtendTypeEnum.FILES
MessageBox.Show("5")
book.DataTables("订单主表_订单主表").DataCols("款式图片").Remote = True 到这里提示错误
MessageBox.Show("6")
book.DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.Host = Tables("FTPIP").Current("FTPhost")
MessageBox.Show("7")
book.DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.Account = Tables("FTPIP").Current("FTPAccount")
MessageBox.Show("8")
book.DataTables("订单主表_订单主表").DataCols("款式图片").FTPClient.password = Tables("FTPIP").Current("FTPpassword")
MessageBox.Show("9")