Foxtable(狐表)用户栏目专家坐堂 → 指定行


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

主题:指定行

帅哥哟,离线,有人找我吗?
大红袍
  111楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/22 9:27:00 [只看该作者]

不明白你什么意思

 

http://www.foxtable.com/webhelp/scr/1148.htm

 


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


加好友 发短信
等级:六尾狐 帖子:1470 积分:8981 威望:0 精华:0 注册:2013/10/24 9:12:00
  发帖心情 Post By:2016/7/22 9:29:00 [只看该作者]

不能上传例子?

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


加好友 发短信
等级:六尾狐 帖子:1470 积分:8981 威望:0 精华:0 注册:2013/10/24 9:12:00
  发帖心情 Post By:2016/7/22 9:30:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:工资软件.rar


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/22 9:38:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:工资软件.zip


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


加好友 发短信
等级:六尾狐 帖子:1470 积分:8981 威望:0 精华:0 注册:2013/10/24 9:12:00
  发帖心情 Post By:2016/7/22 9:51:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:工资表.xls


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


加好友 发短信
等级:六尾狐 帖子:1470 积分:8981 威望:0 精华:0 注册:2013/10/24 9:12:00
  发帖心情 Post By:2016/7/22 9:52:00 [只看该作者]

如何按这个表的形式导出,并按工资摘要的增减而增减列?

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


加好友 发短信
等级:六尾狐 帖子:1470 积分:8981 威望:0 精华:0 注册:2013/10/24 9:12:00
  发帖心情 Post By:2016/7/22 10:43:00 [只看该作者]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:123456.xls


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/22 12:16:00 [只看该作者]

参考代码,自己完善

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:工资软件.zip

 

 

Dim dt As DataTable = DataTables("工资摘要名称")
Dim f1 As String = (projectPath & "\模板\工资表.xls")
Dim f0 As String = (projectpath & "\工资\汇总工资")
If not FileSys.DirectoryExists(f0) Then
    FileSys.CreateDirectory(f0)
End If
Dim f2 As String = (f0 & "\工资.xls")
If FileSys.FileExists(f2) Then
    FileSys.DeleteFile(f2)
End If
FileSys.CopyFile(f1,f2, True)
Dim App As New MSExcel.Application
Dim wb As MSExcel.WorkBook = App.WorkBooks.open(f2)
Dim ws1 As MSExcel.WorkSheet = wb.WorkSheets("工资")

Dim jzkms As List(of String) = dt.GetValues("记账科目", "是否录入 = true", "序号")
Dim idx As Integer = 3
Dim rg = ws1.Range("C:C")
For Each jzkm As String In jzkms
    Dim gzzys As List(Of String) = dt.GetValues("工资摘要", "记账科目 = '" & jzkm & "'", "序号")
    Dim pidx As Integer = idx
    For i As Integer = 0 To gzzys.count-1
        Rg.EntireColumn.Insert(MSExcel.XlInsertShiftDirection.xlShiftToRight)
        ws1.cells(2, idx).Value = gzzys(i)
        ws1.cells(2, idx).HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中       
        idx += 1
    Next
   
    Dim nrg = ws1.range(ws1.cells(1, pidx).address, ws1.cells(1,idx-1).address)
    nrg.Borders.Linestyle = MSExcel.XlLineStyle.xlContinuous  '边框线型
    nrg.Borders.Weight = MSExcel.XlBorderWeight.xlThin'边框粗细
    nrg.Borders.ColorIndex = 1'边框颜色
    nrg.merge
    ws1.cells(1, pidx).value = jzkm
    nRg.HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中
Next
Dim s As String = ws1.cells(1, idx).address.Substring(1,1)
ws1.range(s & ":" & s).delete

rg = ws1.range("6:6")
idx = 0
For Each r As Row In Tables("职工资料").Rows
Rg.EntireRow.Insert(MSExcel.XlInsertShiftDirection.xlShiftDown)
    ws1.cells(r.Index+5, 1).Value = r.Index+1
    ws1.cells(r.Index+5, 2).Value = r("姓名")
idx += 1
Next
ws1.range(idx+5 & ":" & idx+6).Delete

App.Visible = True

'ws1.UsedRange.Formula = ws1.UsedRange.Formula
'app.ActiveWindow.DisplayZeros = False

 


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


加好友 发短信
等级:六尾狐 帖子:1470 积分:8981 威望:0 精华:0 注册:2013/10/24 9:12:00
  发帖心情 Post By:2016/7/22 15:43:00 [只看该作者]

Dim dt As DataTable = DataTables("工资摘要名称")
Dim f1 As String = (projectPath & "\模板\工资表.xls")
Dim f0 As String = (projectpath & "\工资\汇总工资")
If not FileSys.DirectoryExists(f0) Then
    FileSys.CreateDirectory(f0)
End If
Dim f2 As String = (f0 & "\工资.xls")
If FileSys.FileExists(f2) Then
    FileSys.DeleteFile(f2)
End If
FileSys.CopyFile(f1,f2, True)
Dim App As New MSExcel.Application
Dim wb As MSExcel.WorkBook = App.WorkBooks.open(f2)
Dim ws1 As MSExcel.WorkSheet = wb.WorkSheets("工资")
Dim jzkms As List(of String) = dt.GetValues("记账科目", "是否录入 = true", "序号")
Dim idx As Integer = 3
Dim rg = ws1.Range("C:C")
For Each jzkm As String In jzkms
    Dim gzzys As List(Of String) = dt.GetValues("工资摘要", "记账科目 = '" & jzkm & "'", "序号")
    Dim pidx As Integer = idx
    For i As Integer = 0 To gzzys.count-1
        Rg.EntireColumn.Insert(MSExcel.XlInsertShiftDirection.xlShiftToRight)
        ws1.cells(2, idx).Value = gzzys(i)
        ws1.cells(2, idx).HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中
        idx += 1
    Next
    
    Dim nrg = ws1.range(ws1.cells(1, pidx).address, ws1.cells(1,idx-1).address)  ''''
    nrg.Borders.Linestyle = MSExcel.XlLineStyle.xlContinuous  '边框线型
    nrg.Borders.Weight = MSExcel.XlBorderWeight.xlThin'边框粗细
    nrg.Borders.ColorIndex = 1'边框颜色
    nrg.merge
    ws1.cells(1, pidx).value = jzkm
    nRg.HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中

    Dim nrg1 = ws1.range(ws1.cells(3, pidx).address, ws1.cells(3,idx-1).address)  ''''
    nrg1.Borders.Linestyle = MSExcel.XlLineStyle.xlContinuous  '边框线型
    nrg1.Borders.Weight = MSExcel.XlBorderWeight.xlThin'边框粗细
    nrg1.Borders.ColorIndex = 1'边框颜色
    nrg1.merge
    ws1.cells(3,pidx).Formula = "=sum(" & nrg1 & ")"
    nRg1.HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中

Next
'Dim s As String = ws1.cells(1, idx).address.Substring(1,1)
'ws1.range(s & ":" & s).delete
rg = ws1.range("6:6")
idx = 0
Dim n1 As Integer = 0
For Each r As Row In Tables("职工资料").Rows
    Rg.EntireRow.Insert(MSExcel.XlInsertShiftDirection.xlShiftDown)
    ws1.cells(r.Index+5, 1).Value = r.Index+1
    ws1.cells(r.Index+5, 2).Value = r("姓名")
    idx += 1
    For n As Integer = 0 To Tables("工资摘要名称").rows.count-1
        Dim fdr As DataRow = DataTables("过导工资明细表").find("姓名 = '" & r("姓名") & "' and 工资摘要 = '" & ws1.cells(2,3+n).value & "'")
        If fdr IsNot Nothing Then
            ws1.cells(5+n1,3+n).value = fdr("金额")
        End If
    Next
    n1=n1+1
Next
ws1.range(idx+5 & ":" & idx+6).Delete
App.Visible = True
'ws1.UsedRange.Formula = ws1.UsedRange.Formula
'app.ActiveWindow.DisplayZeros = False

  代码中合计、小计以及最后一列的人员工资合计的公式应如何加入代码?ws1.cells(3,pidx).Formula = "=sum(" & nrg1 & ")"

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/22 16:25:00 [只看该作者]

 

Dim dt As DataTable = DataTables("工资摘要名称")
Dim t As Table = Tables("职工资料")
Dim f1 As String = (projectPath & "\模板\工资表.xls")
Dim f0 As String = (projectpath & "\工资\汇总工资")
If not FileSys.DirectoryExists(f0) Then
    FileSys.CreateDirectory(f0)
End If
Dim f2 As String = (f0 & "\工资.xls")
If FileSys.FileExists(f2) Then
    FileSys.DeleteFile(f2)
End If
FileSys.CopyFile(f1,f2, True)
Dim App As New MSExcel.Application
Dim wb As MSExcel.WorkBook = App.WorkBooks.open(f2)
Dim ws1 As MSExcel.WorkSheet = wb.WorkSheets("工资")
Dim jzkms As List(of String) = dt.GetValues("记账科目", "是否录入 = true", "序号")
Dim idx As Integer = 3
Dim rg = ws1.Range("C:C")
Dim cs As new List(of String)
For Each jzkm As String In jzkms
    Dim gzzys As List(Of String) = dt.GetValues("工资摘要", "记账科目 = '" & jzkm & "'", "序号")
    Dim pidx As Integer = idx
    For i As Integer = 0 To gzzys.count-1
        Rg.EntireColumn.Insert(MSExcel.XlInsertShiftDirection.xlShiftToRight)
        ws1.cells(2, idx).Value = gzzys(i)
        ws1.cells(2, idx).HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中
       
        ws1.cells(4, idx).Formula = "=sum(" & ws1.cells(5, idx).address & ":" & ws1.cells(6,idx).address & ")"
        idx += 1
        cs.add(gzzys(i))
    Next
   
    Dim nrg = ws1.range(ws1.cells(1, pidx).address, ws1.cells(1,idx-1).address)  ''''
    nrg.Borders.Linestyle = MSExcel.XlLineStyle.xlContinuous  '边框线型
    nrg.Borders.Weight = MSExcel.XlBorderWeight.xlThin'边框粗细
    nrg.Borders.ColorIndex = 1'边框颜色
    nrg.merge
    ws1.cells(1, pidx).value = jzkm
    nRg.HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中
   
   
    Dim nrg1 = ws1.range(ws1.cells(3, pidx).address, ws1.cells(3,idx-1).address)  ''''
    nrg1.Borders.Linestyle = MSExcel.XlLineStyle.xlContinuous  '边框线型
    nrg1.Borders.Weight = MSExcel.XlBorderWeight.xlThin'边框粗细
    nrg1.Borders.ColorIndex = 1'边框颜色
    nrg1.merge
    ws1.cells(3,pidx).Formula = "=sum(" & ws1.cells(4, pidx).address & ":" & ws1.cells(4,idx-1).address & ")"
    nRg1.HorizontalAlignment = MSExcel.Constants.xlCenter '水平居中
   
Next
Dim s As String = ws1.cells(1, idx).address.Substring(1,1)
ws1.range(s & ":" & s).delete
ws1.cells(3,s).Formula = "=sum(" & ws1.cells(4, 3).address & ":" & ws1.cells(4,idx).address & ")"
rg = ws1.range("6:6")
Dim nidx = 0
For Each r As Row In t.Rows
    Rg.EntireRow.Insert(MSExcel.XlInsertShiftDirection.xlShiftDown)
    ws1.cells(r.Index+5, 1).Value = r.Index+1
    ws1.cells(r.Index+5, 2).Value = r("姓名")
    ws1.cells(r.Index+5, idx).Formula = "=sum(" & ws1.cells(r.Index+5, 3).address & ":" & ws1.cells(r.Index+5,idx-1).address & ")"
    output.show(ws1.cells(r.Index+5, idx).Formula)
    For i As Integer = 0 To cs.count-1
        ws1.cells(r.Index+5, i+3).value= DataTables("工资明细表").compute("sum(金额)", "工资摘要 = '" & cs(i) & "' and 姓名 = '" & r("姓名") & "'")
    Next
    nidx += 1
Next
ws1.range(nidx+5 & ":" & nidx+6).Delete
App.Visible = True
'ws1.UsedRange.Formula = ws1.UsedRange.Formula
'app.ActiveWindow.DisplayZeros = False


 回到顶部