With wb.AddTable("","Table1")
.PageNumber = page
'设置页码
.ActiveSheet = "menu"
Dim nms() As
String = {"NO.","产品","客户","数量","单价","日期"}
.Head.AddRow(nms)
For
Each r As
DataRow
In dt.DataRows
With .Body.AddRow(r("NO."),r("产品"),r("客户"),r("数量"))
.Primarykey = r("_Identify")
'设置主键
.AddCell(Format(r("单价"),"#0.00"))
.AddCell(Format(r("日期"),"MM月dd日"))
End
With
Next
End
With
[此贴子已经被作者于2024/5/5 9:09:01编辑过]
比如放到客户前面
Dim nms() As String = {"NO.","产品","日期","客户","数量","单价"}
.Head.AddRow(nms)
For Each r As DataRow In dt.DataRows
With .Body.AddRow(r("NO."),r("产品"),Format(r("日期"),"MM月dd日"),r("客户"),r("数量"))
.Primarykey = r("_Identify") '设置主键
.AddCell(Format(r("单价"),"#0.00"))
End With
Next
Format(r("发生日期"),"YYYY-MM-dd")
日期设置成2024-05-06,代码如何写?
[此贴子已经被作者于2024/5/6 20:58:15编辑过]