Foxtable(狐表)用户栏目专家坐堂 → 进图条显示完成进度百分比


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

主题:进图条显示完成进度百分比

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/10/30 11:58:00 [显示全部帖子]

For r As Integer = 0 To dt.Rows.Count - 1 '填入数据
    pb.value = (r+1) / dt.rows.count * 100
    For c As Integer = 0 To nms.length -1
        If not dt.rows(r).Isnull(nms(c)) Then Sheet(r +1, c).Value = dt.rows(r)(nms(c))
    Next
Next

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/1 19:33:00 [显示全部帖子]

Dim rkqssj As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
Dim rkjzsj As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker2")
Dim pb As WinForm.ProgressBar = e.Form.Controls("ProgressBar1")


DataTables("库存明细表").LoadFilter = "入库完成时间 > = '" & rkqssj.value & "' and 入库完成时间 < = '" & rkjzsj.value.AddDays(1) & "' and 状态 = '入库完成'"
DataTables("库存明细表").Load

msgbox("现在开始")
Dim dt As Table = Tables("库存明细表")
Dim filepath As String = "C:\库存明细表\在库\" & rkqssj.value & "-" & rkjzsj.value & ".xls"


Dim nms() As String = {"SN","MAC","HW","库位类别","生产订单号码","工单行号","订单号","订单行号","物料编码","物料名称","博达物料编码","软件版本","入库完成时间"} '要导出的列名
Dim caps() As String = {"SN","MAC","HW","库位类别","生产订单号码","工单行号","订单号","订单行号","物料编码","物料名称","博达物料名称","软件版本","入库完成时间"} '对应的列标题
Dim szs() As Integer = {120,200,200,80,200,80,100,80,100,150,100,100,150} '对应的列宽
Dim Book As New XLS.Book '定义一个Excel工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
Dim st1 As XLS.Style = Book.NewStyle '日期列的显示格式
st1.Format = "yyyy-MM-dd"
For c As Integer = 0 To nms.length -1
    Sheet(0, c).Value = caps(c) '指定列标题
    Sheet.Cols(c).Width = szs(c) '指定列宽
    If dt.Cols(nms(c)).IsDate Then '如果是日期列
        Sheet.Cols(c).Style = st1 '设置显示格式
    End If
Next
For r As Integer = 0 To dt.Rows.Count - 1 '填入数据
    pb.value = (r+1) / dt.rows.count * 100
    application.doevents
    output.show(pb.value)
    For c As Integer = 0 To nms.length -1
        If not dt.rows(r).Isnull(nms(c)) Then Sheet(r +1, c).Value = dt.rows(r)(nms(c))
    Next
Next
Book.Save(filepath)


MessageBox.show("保存路径:" & FilePath,"导出成功",MessageBoxButtons.OK,MessageBoxIcon.Information)


 回到顶部