Subject: RE: POSSIBLE BUG: Class: Richtextitem; Method: AppendTable; Parameter: opt. rtpstylearray
Maybe my example was not very clear.
If we look at the notes help file (below or in Notes R6 Designer Help).
You will see a description of what Lotus says about the method AppendTable.
My understanding is that rtpsStyleArray is the settings for each column’s paragraph.
That means from my example rightmargin for column 1 is 5cm and rightmargin for column 2 is 10.5
Yet, what has been applied is
cell 1(r1,c2) = rtpstyle(1),
cell 2(r1,c2) = rtpstyle(2), but rightmargin of rtpstyle(1)
cell 3(r2,c1) = a mixer of rtpstyle(1) and rtpstyle(2)
cell 4(r2,c2) = a mixer of rtpstyle(1) and rtpstyle(2), anyone’s guest.
Lotus’s Description states:
“The array must contain one element for each column in the table in sequence”
To me this means: each demension of array = column’s paragraph style.
i.e
(Sorry best I can do with variable font.)
|____________________|
|rtpstyle(1)|rtpstyle(2) |
|____________________|
|rtpstyle(1)|rtpstyle(2) |
|____________________|
cell 1(r1,c2) = rtpstyle(1)
cell 2(r1,c2) = rtpstyle(2)
cell 3(r2,c1) = rtpstyle(1)
cell 4(r2,c2) = rtpstyle(2)
This is what happening.
In my example I had set the Columns margin to
column1 = 5cm and column2 = 10.5
Lets ignore the leftmargins are they are all the same…
Table Leftmargin = 1.5cm
Every Cell Leftmargin = 1.5cm
My concern is that rtpstyle(2) is suppose to have a rightmargin of 10.5 and yes it spans the column to 10.5 but every column 2 has a rightmargin of column 1 cell (5cm).
i.e
|5cm|10cm____|
|^LM_______________RM^|_^LM_____ ^RM(@5cm)____|
|____________|__(takes on r1,c1 right margin)|
||____________|
On top of that you also get the alignment all out of wack.
|LEFT____|CENTER|
|CENTER|CENTER|
what should apply according to the Designer Help and Example is:
i.e demension 1 is applied to column one
demension 2 is applied to column two.
so on...........
|5cm|10cm___|
|^LM_______________RM^|_^LM_____________________________RM^|
|Left________________|CENTER|
||______________|
|^LM_______________RM^|_^LM_____________________________RM^|
|Left________________|CENTER|
||______________|
Has anyone had this functioning correctly?
If so, could you please provide a quick example?
I like to test it against my understanding of how its applied.
Extract from the Notes Help file.
Call notesRichTextItem.AppendTable( rows%, columns% [, labels] [, leftMargin&] [, rtpsStyleArray] )
Parameters
• rows%
Integer. Number of rows in the table.
• columns%
Integer. Number of columns in the table.
• labels
Array of type String. Optional. Text of labels for a tabbed table. The number of array elements must equal the number of rows. Omitting this parameter appends a basic table. Including this parameter appends a tabbed table.
• leftMargin&
Long. Optional. Left margin of the table in twips. Defaults to 1440. The following constants are available:
RULER_ONE_CENTIMETER (567)
RULER_ONE_INCH (1440)
• rtpsStyleArray
Array of type NotesRichTextParagraphStyle. Optional. Creates a table with fixed-width columns and style attributes as specified. Omitting this parameter creates an auto-width table. The array must contain one element for each column in the table in sequence. Explicitly set the first line left margin and left margin, which control the start of text relative to the start of the column, and the right margin, which controls column width.
Example 4
________-
This view action creates a basic table of 4 rows and 3 columns, and populates it. The width of each column is fixed at 1.5 inches. The left margin of the table is 1.5 inches.
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
REM Create document with Body rich text item
Dim doc As New NotesDocument(db)
Call doc.ReplaceItemValue(“Form”, “Main topic”)
Call doc.ReplaceItemValue(“Subject”, “Table 4 x 3”)
Dim body As New NotesRichTextItem(doc, “Body”)
REM Create table in Body item
rowCount% = 4
columnCount% = 3
Dim styles(1 To 3) As NotesRichTextParagraphStyle
For i% = 1 To 3 Step 1
Set styles(i%) = session.CreateRichTextParagraphStyle
styles(i%).LeftMargin = 0
styles(i%).FirstLineLeftMargin = 0
styles(i%).RightMargin = RULER_ONE_INCH * 1.5
Next
Call body.AppendTable _
(rowCount%, columnCount%, RULER_ONE_INCH * 1.5, styles)