老师,请问我怎么才能用当天日期去展开指定月的目录树并选择当天日期呢?我这些写的时候就报错了
Dim y As Integer = Date.Today.Year
Dim m As Integer = Date.Today.Month
Dim d As Integer = Date.Today.day
Dim g As New GroupTableBuilder("SQL_JYRB", DataTables("JYRB"))
g.Groups.AddDef("dpm")
g.Groups.AddDef("DateTime",DateGroupEnum.Year,"年")
g.Groups.AddDef("DateTime",DateGroupEnum.month,"月")
g.Groups.AddDef("DateTime",DateGroupEnum.day,"日")
g.Totals.AddDef("bghjnm")
g.Totals.AddDef("cdspnm")
g.Totals.AddDef("cdhjnm")
g.VerticalTotal = True
g.Decimals = 2
g.FromServer = True
Tables("经营数据日报_Table1").DataSource = g.BuildDataSource()
Tables("经营数据日报_Table1").AutoSizeCols()
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("经营数据日报_Table1","年|月|日")
trv.Nodes(y).Expand
trv.Nodes(y).Nodes(m).Expand ‘这里报错了:指定的参数已超出有效值的范围。参数名: index’
怎么选定到当天的节点还不知道怎么写,请老师指导!