- Public Sub ButtunClick(sender As Object, e As SpreadsheetGear.Windows.Controls.ShapeActionEventArgs)
- If e.Shape.Name = "Button 1" Then
- '通过回调获得数据。
- Dim GetData As Action(Of JArray) = Function(res As JArray)
- Dim i As Integer
- EV.GetLock()
- '行数不足,先插入行
- App.KBInsertRows("T_274",2)
- '获取到结果后开始遍历
- For Each Row As JObject In Res
- '写入单元格
- Range("C6").Cells(i,0).Value = Row("USERNAME").ToString
- Range("D6").Cells(i,0).Value = Row("LOGTYPE").ToString
- i += 1
- Next
- EV.ReleaseLock()
- End Function
- '执行SQL获取数据
- App.KBRES("SELECT TOP 5 USERNAME,LOGTYPE FROM SYS_LOG", GetData)
- End If
- End Sub'按钮/标签点击事件
复制代码
|
|
bj_zm