Large tables

Hi all,

In my application (web) I need to generate large tables. I used to do that by writting HTML into text fields (computed for display). The tables became larger and this didn’t work anymore, so I switched to rich text fields. That was better. But the amount of data just kept growing and now I reached the limit of these fields.

I then tried to use the “official” tables for rich text fields (AppendTable and so on) but these tables can only have 255 rows and that’s not enough. Besides the fact that it takes several minutes to find that out (which ofcourse is not acceptable the code is below).

Does anyone has a suggestion on how to proceed?

Thanks in advance,

Joost

Sub Initialize

Dim view As NotesView

Dim doc As NotesDocument

Dim rti As NotesRichTextItem

Dim table As NotesRichTextTable

Dim rtnav As NotesRichTextNavigator

Dim count As Integer



Set session = New NotesSession

Set db = session.CurrentDatabase

Set context = session.DocumentContext

Set view = db.GetView("TheView")

count = 0



Set rti = context.GetFirstItem("TableField")

Call rti.AppendTable(1,5)

Set rtnav = rti.CreateNavigator

Call rtnav.FindFirstElement(RTELEM_TYPE_TABLE)

Set table = rtnav.GetElement

Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL)

Set doc = view.GetFirstDocument



While Not doc Is Nothing

	Call rti.BeginInsert(rtnav)

	Call rti.AppendText(doc.ID(0))

	Call rti.EndInsert

	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)

	Call rti.BeginInsert(rtnav)

	Call rti.AppendText(doc.Name(0))

	Call rti.EndInsert

	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)

	Call rti.BeginInsert(rtnav)

	Call rti.AppendText("fill 1")

	Call rti.EndInsert

	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)

	Call rti.BeginInsert(rtnav)

	Call rti.AppendText("fill 2")

	Call rti.EndInsert

	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)

	Call rti.BeginInsert(rtnav)

	Call rti.AppendText("fill 3")

	Call rti.EndInsert

	

	Set doc = view.GetNextDocument(doc)

	If Not doc Is Nothing Then

		Call table.AddRow(1)

	End If



	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)

	

Wend

End Sub

Subject: large tables

The only suggestion would be to use multiple “real” tables, usually not more than about 100 rows in each. While the limit on rows is 255, I have seen rendering and performance issues if you go too high beyond 100 rows. You can often arrange these tables so it is not clear that they are separate tables at all.

Of course, it really depends on what you are using the tables for. You may want to continue with the HTML approach if you need to step through the table with JavaScript, or anything like that.