Posts Tagged ‘table’
Table Data Wrong
Written by WishBoNe on November 28, 2007 – 3:18 pmHave been trying to populate a table but the last cell at the bottom right often end up with all the information in the array backwards. I’m not sure what is wrong here. Using 2 arrays to store the information and creating a table looked easy. Unfortunately, the information being populated looked awkward.
Code used:
Set rtFld = New NotesRichTextItem (nDoc, “sRptResults”)
tblRow = divCnt
tblCol = 3
Set rtNav = rtFld.CreateNavigator
Call rtFld.AppendTable(tblRow, tblCol)
Call rtNav.FindFirstElement(RTELEM_TYPE_TABLECELL)
For i = 1 To tblCol
For k = 1 To tblRow While k <= tblRow
Call rtFld.BeginInsert(rtNav)
Call rtFld.AppendText (k)
Call rtFld.EndInsert
Call rtNav.FindNextElement(RTELEM_TYPE_TABLECELL)
Call rtFld.BeginInsert(rtNav)
Call rtFld.AppendText (divNameList(k))
Call rtFld.EndInsert
Call rtNav.FindNextElement(RTELEM_TYPE_TABLECELL)
Call rtFld.BeginInsert(rtNav)
Call rtFld.AppendText (divCntList(k))
Call rtFld.EndInsert
Call rtNav.FindNextElement(RTELEM_TYPE_TABLECELL)
Next Wend
Next
Call nDoc.Save (False, False)
Wonder what is wrong.
Update: Just change the inner loop to a While loop and it works find!
Tags: code, loop, problem, program, table
Posted in Career, Design, Domino, IBM, Life, Lotus Notes, Software, Technology, Work | No Comments »















