I am trying to generate a table with this code. It contains 9 column.
WHile the data is there when I printed it to a text file, the html was out bizarre. Please help
Sub Initialize
Dim s As New NotesSession
Dim dbCurrent As NotesDatabase
Dim dbMain As NotesDatabase
Dim doc As NotesDocument
Dim TeamAssCollection As NotesDocumentCollection
Dim TeamDoc As NotesDocument
Dim AsscDoc As NotesDocument
Dim numberItem As NotesItem
Set dbCurrent= s.CurrentDatabase
serverName=dbCurrent.Server
Dim Assview As NotesView
Dim AssmDB As NotesDatabase
Dim i As Integer
Dim sInfo As String
Dim cInfo As String
Set doc=s.DocumentContext
classInfo=doc.ClassInfo(0)
'classInfo="P02-1648"
Path$ = fGeneratePath( "" )
Set dbMain = s.GetDatabase(serverName, Path$ +"ielsmain.nsf")
Set AssmDB =s.GetDatabase(serverName, Path$ +"ielsassess.nsf")
Dim vTeamList As Variant
Dim view As NotesView
Dim Marks As Double
Dim item As NotesItem
Dim htmlrow As String
Set mainView=dbMain.getview("TeamByClass")
Set Assview=dbcurrent.getview("MentorTraitAssByStudentNo")
Set Assview1=dbcurrent.GetView("AssesComputationView")
Set Assview2=dbcurrent.GetView("OutcomeAss")
Set TeamDocsCollection=mainView.getalldocumentsbykey(classInfo, True)
Set TeamDoc=TeamDocsCollection.getfirstdocument
htmlstart= "<Table>"
While Not TeamDoc Is Nothing
TeamID=TeamDoc.teamID(0)
If TeamDoc.Form(0)<>"team formation" Then
Set TeamDoc=TeamDocsCollection.getnextdocument(teamdoc)
Else
'Count How many members there are in the team
TeamMemberList=TeamDoc.StudentNotesNameList
StudentNoList=TeamDoc.StudentNoList
TeamName=TeamDoc.TeamName(0)
Fullname=TeamDoc.StudentFullNameList
For i=0 To Ubound(teamMemberList)
Set MentorTraitDoc=Assview.GetDocumentByKey(StudentNoList(i), True)
If Not MentorTraitDoc Is Nothing Then
IEValue1=MentorTraitDoc.IETraitvalue_1(0)
IEValue2=MentorTraitDoc.IETraitvalue_2(0)
IEValue3=MentorTraitDoc.IETraitvalue_3(0)
IEValue4=MentorTraitDoc.IETraitvalue_4(0)
IEValue5=MentorTraitDoc.IETraitvalue_5(0)
IEValueTotal#=Cint(IEValue1)+Cint(IEvalue2)+Cint(IEValue3)+Cint(IEValue4)+Cint(IEValue5)
IEValueTotalRaw=Cint((IEValueTotal#/50*60))
htmlrow=htmlrow+ "<tr><td width=80>"+Cstr(IEValue1)+"<td width=80>"+Cstr(IEValue2)+"<td width=80>"+Cstr(IEValue2)+"<td width=80>"+Cstr(IEValue3)+"<td width=80>"+Cstr(IEValue4)+"<td width=80>"+Cstr(IEValue5)+"<td width=80>"+Cstr(IEValueTotal#)+"</td>|"
Else
htmlrow=htmlrow+"<tr><td width=80> <td width=80> <td width=80> <td width=80> <td width=80> <td width=80> <td width=80> </td>"
End If
Set PeerComponentDoc=Assview1.GetDocumentbyKey(StudentNoList(i))
If Not PeerComponentDoc Is Nothing Then
PeerComponent=PeerComponentDoc.Score(0)
Else
Peercomponent=" '"
End If
Set OutcomeDoc=Assview2.GetDocumentbyKey(TeamID)
If Not OutcomeDoc Is Nothing Then
OutcomeScore=OutcomeDoc.TotalMark(0)
Else
OutcomeScore=" '"
End If
htmlrow=htmlrow+"<td width=80>"+Cstr(IEValueTotalRaw)+"<td width=80>"+Cstr(Peercomponent)+"<td width=80>"+Cstr(OutcomeScore)+"<td>"
Textfile=Textfile+"*"+StudentNoList(i)+";"+ FullName(i)+";"+IEValue1+";"+ IEValue2+";"+IEValue3+";"+IEValue4+";"+IEValue5+";"+Cstr(IEValueTotalRaw)+";"+Cstr(IEvalueTotalRaw)+";"+Cstr(PeerComponent)+";"+Cstr(OutcomeScore)
Next i
End If
Set TeamDoc=TeamDocsCollection.getnextdocument(teamdoc)
Wend
HtmlBody=Htmlstart+htmlorw+"</table>"
Print HTMLBody
End Sub