Foxtable(狐表)用户栏目专家坐堂 → 请教怎么根据规格生成不同编码


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

主题:请教怎么根据规格生成不同编码

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


加好友 发短信
等级:三尾狐 帖子:732 积分:5491 威望:0 精华:14 注册:2011/8/28 12:49:00
  发帖心情 Post By:2012/8/27 14:39:00 [显示全部帖子]

Dim Book As new XLS.Book
Dim Sht As XLS.Sheet = Book.Sheets(0)

Dim r As Long = 0
Sht(r,0).Value = "品类"
Sht(r,1).Value = "固定字段"
Sht(r,2).Value = "编码"
For Each Dr As DataRow In DataTables("表A").DataRows
    If Not Dr.IsNull("品类") Then
        For i As Integer = 1 To Dr("数量")
            R + = 1
            Sht(r,0).Value = Dr("品类")
            Sht(r,1).Value = Dr("固定字段")
            Sht(r,2).Value = Dr("品类") & Dr("固定字段") & Format(i,"000")
        Next
    End If
    R + = 1
Next

 

Dim Style As xls.style = book.NewStyle
Style.FontBold = True
Sht.Rows(0).Style = Style

 

Book.Save("d:\test.xls")


Dim proc As new Process
proc.File = "d:\test.xls"
proc.Start

[此贴子已经被作者于2012-8-27 14:40:19编辑过]

 回到顶部