的多個工作表我想具體的行輸出到Excel中的多張取決於日期從數據表在vb.net如何導出設置取決於日期行的數據表,從到Excel
我的代碼
我希望17/08/2016在一張紙18/08/2016在nextsheet。 我的錶行這樣的:
s.no date
1 17/08/2016
2 17/08/2016
3 17/08/2016
4 18/08/2016
5 18/08/2016
For i = 0 To dt.Rows.Count - 2
If dt.Rows(i).Item("AttDate") = dt.Rows(i + 1).Item("AttDate") Then
oSheet = oBook.Worksheets(1)
oSheet.Cells(Irow, IcolFranchisee) = dt.Rows(i).Item("Intime")
If dt.Rows(i).Item("latein") > 0 Then
oSheet.Cells(Irow, IcolFranchisee + 1) = dt.Rows(i).Item("latein")
Else
oSheet.Cells(Irow, IcolFranchisee + 2) = dt.Rows(i).Item("latein")
End If
Irow = Irow + 1
Else
osheet1 = oBook.Worksheets(2)
osheet1.Cells(Irow, IcolFranchisee) = dt.Rows(i).Item("Intime")
If dt.Rows(i).Item("latein") > 0 Then
osheet1.Cells(Irow, IcolFranchisee + 1) = dt.Rows(i).Item("latein")
Else
osheet1.Cells(Irow, IcolFranchisee + 2) = dt.Rows(i).Item("latein")
End If
Irow = Irow + 1
End If
Next
有問題嗎? – Leprechaun
是........... – iswarya
你能解釋一下這個問題嗎? – Leprechaun