-- 作者:linswcfr
-- 发布时间:2017/8/5 14:15:00
--
看了帮助,还是不明白,要怎么判断?
With wb.AddTable("","Table1") Dim nms() As String = Vars("sc").Split(",") For Each dr As DataRow In DataTables("表A").Select("",",金额 desc") With .Body.AddRow() .AddCell(dr(nms(1))) .AddCell(dr(nms(2))) \'第二个参数用于设置单元格的Attribute属性 .AddCell(dr(nms(3))) .AddCell(dr(nms(4))) .AddCell(Format(dr(nms(5)),"#,##0.00")) .AddCell(Format(dr(nms(6)),"#,##0.00")) .AddCell(Format(dr(nms(7)),"#,##0.00")) .AddCell(Format(dr(nms(8)),"P")) .AddCell(Format(dr(nms(9)),"#,##0.00")) .AddCell(Format(dr(nms(10)),"P")) .AddCell(Format(dr(nms(11)),"#,##0.00")) .AddCell(Format(dr(nms(12)),"P")) .AddCell(Format(dr(nms(13)),"#,##0.00")) .AddCell(Format(dr(nms(14)),"P")) .AddCell(Format(dr(nms(15)),"#,##0.00")) .AddCell(Format(dr(nms(16)),"P")) .AddCell(Format(dr(nms(17)),"#,##0.00")) .AddCell(Format(dr(nms(18)),"P")) .AddCell(Format(dr(nms(19)),"#,##0.00")) .AddCell(dr(nms(20))) .AddCell(dr(nms(21))) End With Next End With
|
-- 作者:有点蓝
-- 发布时间:2017/8/5 14:46:00
--
比如 .AddCell(IIF(dr(nms(5)) > 0 ,Format(dr(nms(5)),"#,##0.00"),"") .AddCell(IIF(dr(nms(6)) > 0 ,Format(dr(nms(6)),"#,##0.00"),"")
|