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 tbl As Table = Tables("职工一览表")
Dim hdr As Integer = tbl.HeaderRows
Dim cnt As Integer
Dim Book As New XLS.Book
Dim Sheet As XLS.Sheet = Book.Sheets(0)
tbl.CreateSheetHeader(Sheet)
For c As Integer = 0 To tbl.Cols.Count - 1
If tbl.Cols(c).Visible Then
For r As Integer = 0 To tbl.Rows.Count - 1
sheet(r + hdr,cnt).value = tbl(r,c)
Next
cnt = cnt + 1
End If
Next
Book.Save("c:\reports\test.xls")
Dim Proc As New Process
Proc.File = "c:\reports\test.xls"
Proc.Start()