以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  甘特图出错,请老师核查代码,谢谢  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=79966)

--  作者:jamhuton
--  发布时间:2016/1/13 10:24:00
--  甘特图出错,请老师核查代码,谢谢
If DrawGannt Then
    Dim r As Row  = Tables("进口业务进度表").Rows(e.Row.Index)
    Dim dt1 As Date = r("接单日期")
    Dim dt2 As Date = r("到港日期")
    Dim dt3 As Date = r("报关完结")
    Dim dt4 As Date = r("送货日期")
    Dim dt As Date = e.Col.Name.Replace("年","-").Replace("月_","-")
    If dt>=dt1 AndAlso dt<=dt2 Then
        e.StartDraw()
        If dt < Date.Today Then
            e.Graphics.FillRectangle(Brushes.Green,e.x ,e.y + 5, e.Width, e.Height - 10)
        Else
            e.Graphics.FillRectangle(Brushes.Red,e.x ,e.y + 3, e.Width, e.Height - 7)
        End If
        e.EndDraw()
    End If
    If dt>=dt2 AndAlso dt<=dt3 Then
        e.StartDraw()
        If dt < Date.Today Then
            e.Graphics.FillRectangle(Brushes.Yellow,e.x ,e.y + 5, e.Width, e.Height - 10)
        Else
            e.Graphics.FillRectangle(Brushes.Red,e.x ,e.y + 3, e.Width, e.Height - 7)
        End If
        e.EndDraw()
    End If
    If dt>=dt3 AndAlso dt<=dt4 Then
        e.StartDraw()
        If dt < Date.Today Then
            e.Graphics.FillRectangle(Brushes.Blue,e.x ,e.y + 5, e.Width, e.Height - 10)
        Else
            e.Graphics.FillRectangle(Brushes.Red,e.x ,e.y + 3, e.Width, e.Height - 7)
        End If
        e.EndDraw()
    End If
End If

错误信息:
编译错误:未声明名称 \'drawgannt\'
错误代码:if drawgannt then

--  作者:Hyphen
--  发布时间:2016/1/13 10:41:00
--  
没有 声明名称:DrawGannt 
--  作者:jamhuton
--  发布时间:2016/1/13 11:20:00
--  
我是完全按照例子来做的呀,到drawcell代码就出错,说没声明名称
--  作者:Hyphen
--  发布时间:2016/1/13 11:23:00
--  

5、在全局代码中定义一个Public变量


Public DrawGannt As Boolean = True


DrawGannt相当于一个开关,将其设置为True,正常绘制甘特图,将其设置为False,暂停绘制甘特图。


--  作者:jamhuton
--  发布时间:2016/1/13 11:28:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20160113112700.png
图片点击可在新窗口打开查看

这个有写进去的呀

--  作者:jamhuton
--  发布时间:2016/1/13 11:29:00
--  
早上还是好的,我发布的时候出现这个提示,然后回头这个甘特图就不显示了
--  作者:jamhuton
--  发布时间:2016/1/13 11:35:00
--  

[此贴子已经被作者于2016/1/13 12:28:45编辑过]

--  作者:jamhuton
--  发布时间:2016/1/13 11:35:00
--  
上传项目了,老师帮我看看


--  作者:jamhuton
--  发布时间:2016/1/13 11:36:00
--  
密码还是昨天发给你的那个


--  作者:Hyphen
--  发布时间:2016/1/13 12:05:00
--  
版主这2天请假,密码单独发我一下