还是没搞定。如何修改代码?请指教。谢谢!
Dim Values() As String = {"问卷"}
Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.Filter= "Excel文件|*.xls" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
For Each Value As String In Values
For Each dw As String In DataTables("校名设置").GetUniqueValues("统计单位 = '统计'", "单位")
For Each bm As DataTable In DataTables
If bm.name <> "问卷答案" AndAlso bm.Name <> "校名设置" AndAlso bm.Name <> "对应科目"
Dim Hjs() As String = {"A计","B计","C计","得分"}
For Each Hj As String In Hjs
For Each fdr As DataRow In bm.Select("选项 = '" & Hj & "'")
Dim pos As Integer = Tables(bm.Name).FindRow(fdr)
Dim ns As C1.Win.C1FlexGrid.CellStyle = Tables(bm.Name).grid.Styles.Add("自定义的样式")
ns.ForeColor = Color.Red
ns.Font = New Font("宋体",9, FontStyle.Bold)
For i As Integer = 0 To Tables(bm.Name).Cols.Count - 1
Tables(bm.Name).Grid.SetCellStyle(pos+2, i+1, ns)
Tables( dw & value & "分科目得分").SaveExcel(dlg.FileName, dw & value & "分科目得分") '保存文件
Next
Next
Next
End If
Next
Next
Next
End If