Ja hab ich :-)
Habs kurz überflogen. Es könnte daran liegen dass Du nur auf die 1. Tabelle zugreifst ?
siehe z.B. den Code in createReport
Call body.AppendTable( totalRows, COLUMN_COUNT,,, tableColStyles)
'erstellt eine neue Tabelle
Set rtNav = body.CreateNavigator
'>
Call rtNav.GetFirstElement(RTELEM_TYPE_TABLE)
'>Diese Zeile holt aber wieder die 1. Tabelle, egal wieviele TAbellen Du erstellst :-)
bzw. in der Funktion populateTable auf den RTNav verwiesen wird von createReport.
Nicht ganz schwierig :-)
z.B. durch übergabe eines Parameters an createReport
oder Du könntest auch die Anzahl tabellen in einer globalen Variablen speichern.
Function createReport(tabell as integer) As Integer
On Error Goto errHandler
createReport = True
Dim color As NotesColorObject
Dim columnHeader(9) As String
Dim tableColStyles(1 To 9) As NotesRichTextParagraphStyle
columnHeader(1) = "Link" ' Initialize column header values
columnHeader(2) = "Datum"
columnHeader(3) = "Von - Bis"
columnHeader(4) = " Kundenname"
columnHeader(5) = "Kontakt Typ"
columnHeader(6) = " Projektname"
columnHeader(7) = "Produkt"
columnHeader( = "Zielsetzung"
columnHeader(9) = "Ergebnis"
' Populate the array of NotesRichTextParagraphStyle - one array element (one NotesRichTextParagraphStyle) for each column.
For i = 1 To COLUMN_COUNT Step 1
Set tableColStyles(i) = session.CreateRichTextParagraphStyle ' Create the rt paragraph style for this column
tableColStyles(i).FirstLineLeftMargin = 0 ' Set left margin for the first line of each cell in column
tableColStyles(i).LeftMargin = 0 ' Set left margin for all but the first line of each cell in column
Select Case i
Case 1
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 0.7
tableColStyles(i).Alignment = ALIGN_CENTER
Case 2
'tableColStyles(i).LeftMargin = RULER_ONE_CENTIMETER * 0.1
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 2
Case 3
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 3
Case 4
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 4
Case 5
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 2
Case 6
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 2
tableColStyles(i).Alignment = ALIGN_CENTER
Case 7
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 2
tableColStyles(i).Alignment = ALIGN_CENTER
Case 8
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 2
tableColStyles(i).Alignment = ALIGN_CENTER
Case 9
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 2
tableColStyles(i).Alignment = ALIGN_CENTER
End Select
Next
Call body.AppendTable( totalRows, COLUMN_COUNT,,, tableColStyles)
Set rtNav = body.CreateNavigator
Call rtNav.GetFirstElement(RTELEM_TYPE_TABLE)
if (tabelle > 1 ) then
for i=0 to tabelle-1
call rtnav.getNextElement(RTELEM_TYPE_TABLE)
next
end if
Set rtTable= rtNav.GetElement
rtTable.Style = TABLESTYLE_TOP
Set color = session.CreateColorObject ' Create color object for use in setting cell colors
color.NotesColor = COLOR_LIGHT_GRAY
Call rtTable.SetColor( color ) ' Set the top row color to light gray background
color.NotesColor = COLOR_WHITE
Call rtTable.SetAlternateColor( color ) ' Set all rows after the top row to white background
Call rtNav.FindFirstElement( RTELEM_TYPE_TABLECELL ) ' Move to the first cell - row 1, col 1
Call body.AppendStyle( rtHelv8_Black_Bold ) ' Set the font to Helvetica, 8-point, bold black
For col = 1 To COLUMN_COUNT Step 1
Call body.BeginInsert( rtNav )
Call body.AppendText( columnHeader(col) ) ' Write the text for this column's header
Call body.EndInsert ' Move insertion point to the end of this cell
Call rtNav.FindNextElement( RTELEM_TYPE_TABLECELL ) ' Move to the next cell
Next
finally:
Exit Function
errHandler:
createReport = False
Dim strErrMsg As String
Select Case Err
Case Else
strErrMsg = "Error #" & Err & Chr$(10) & Error$ & Chr$(10) & "Line #" & Erl & | in sub/function: "| & Lsi_info(2) & |"|
Msgbox strErrMsg, 16, "Unexpected error"
End Select
Resume finally
End Function