以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- excel报表问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=115002)
|
-- 作者:mamuaiqing
-- 发布时间:2018/2/27 16:02:00
-- excel报表问题
Dim hs As Integer Dim zdnf As Integer For t As Integer = 0 To pzmx.DataRows.Count -1 \'明细填充 Dim ye As Double If pzmx.DataRows(t)("科目编号") = Product Then If Sheet(7,4).Value = "" Then Sheet(7,4).Value = pzmx.DataRows(t)("制单日期").Year & "年" Sheet(7,4).Style = Style4 zdnf = pzmx.DataRows(t)("制单日期").Year Else hs = hs + 1 If zdnf <> pzmx.DataRows(t)("制单日期").Year Then Sheet.MergeCell(7+hs,4,1,2) \'第5行第2列开始合并1行,3列 End If End If hs = hs + 1 如图所示,把第11行代码 hs = hs +1 去掉就不报错,这问题怎么解决,请教老师,谢谢 此主题相关图片如下:111111.jpg
|
-- 作者:有点甜
-- 发布时间:2018/2/27 16:38:00
--
是否这句代码出错? If Sheet(7,4).Value = "" Then
试试改成 If Sheet(7,4).text = "" Then
|
-- 作者:mamuaiqing
-- 发布时间:2018/2/27 17:28:00
--
感谢老师,查看了下是底下有个代码错了
Dim qcye1 As Double
Sheet(9 + hs - 1,13).Value = Format(pzmx.DataRows(t)("金额"),"n")
qcye1 = Sheet(9 + hs - 1,13).Value 这行问题!
这里转换为什么不行呢?请教老师,谢谢
测试下面的转换是正常的
Dim zf As Double = 1234.01 Dim gg As String = Format(zf,"n") \'12,345.60 Dim jj As Double = gg Output.Show(jj)
|
-- 作者:有点甜
-- 发布时间:2018/2/27 18:11:00
--
当这种情况,就有问题了
Dim gg As String = "" Dim jj As Double = gg Output.Show(jj)
你要加入判断
Dim gg As String = "" Dim jj As Double = iif(gg="", nothing, gg) Output.Show(jj)
[此贴子已经被作者于2018/2/27 18:11:35编辑过]
|