-- 作者:zhaogan
-- 发布时间:2015/11/16 22:02:00
--
Dim ckl As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1") Dim nms As New List(of String) For i As Integer = 0 To ckl.Items.count - 1 If ckl.GetItemChecked(i) Then nms.Add(ckl.Items(i)) End If Next If nms.Count = 0 Then MessageBox.Show("至少要选择一列","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Return End If
Dim dt As Table = Tables("评定计算_桩号明细") Dim Book As New XLS.Book(ProjectPath & "Attachments\\混凝土评定.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
For r As Integer = 0 To dt.Rows.Count - 1 For i As Integer = 0 To nms.count -1 Sheet(r + 5, i).Value = dt.rows(r)(nms(i)) Next Next
Book.Save("c:\\reports\\test.xls") Dim Proc As New Process Proc.File = "c:\\reports\\test.xls" Proc.Start() 此主题相关图片如下:列表截图.png
|