Domino 9 und frühere Versionen > ND6: Entwicklung
LotusScript + HTML + dynamische Tabelle
koehlerbv:
Ich habe lange nichts mehr "extraordinäres" mit der RichtTextParagraphStyle gemacht, aber bezog sich der veränderte Rand immer relativ zum "Standardrand" von 1 Zoll ? Ggf. müsstest Du also auch mit negativen Werten arbeiten.
Bernhard
sja:
leider ist es alles für mich nicht ganzklar: wo wird "Standardrand" fest gestellt und wo und wie sonn negative Werte verwndet werden?
die Code für die Tabelle sehen so aus:
Dim color As NotesColorObject
Dim columnHeader(12) As String
Dim tableColStyles(1 To 12) As NotesRichTextParagraphStyle
columnHeader(1) = "Link" ' Initialize column header values
columnHeader(2) = "Projekt"
columnHeader(3) = "Bereich"
columnHeader(4) = "Vorgang"
columnHeader(5) = "Stufe"
columnHeader(6) = "Ort"
columnHeader(7) = "Datum"
columnHeader(8) = "von"
columnHeader(9) = "bis"
columnHeader(10) = "Dauer"
columnHeader(11) = "MA"
columnHeader(12) = "Tätigkeit"
' 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.2
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 3
Case 3
tableColStyles(i).LeftMargin = RULER_ONE_CENTIMETER * 0.2
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 2
Case 4
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 4
Case 5
tableColStyles(i).LeftMargin = RULER_ONE_CENTIMETER * 0.2
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 3
Case 6
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 1
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 * 1
tableColStyles(i).Alignment = ALIGN_CENTER
Case 9
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 1
tableColStyles(i).Alignment = ALIGN_CENTER
Case 10
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 1.5
tableColStyles(i).Alignment = ALIGN_RIGHT
Case 11
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 1
tableColStyles(i).Alignment = ALIGN_CENTER
Case 12
tableColStyles(i).LeftMargin = RULER_ONE_CENTIMETER * 0.2
tableColStyles(i).RightMargin = RULER_ONE_CENTIMETER * 8
End Select
Next
Call body.AppendTable( totalRows, COLUMN_COUNT,,, tableColStyles)
Set rtNav = body.CreateNavigator
Call rtNav.GetFirstElement(RTELEM_TYPE_TABLE)
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
Danke schön
Sofia
koehlerbv:
Wo weist Du eigentlich den Style Deinem RTI zu ? Hier fehlt doch noch sowas wie
Call richText.AppendParagraphStyle(rtpStyle)
... oder ich habe es übersehen ... ;)
Bernhard
sja:
Hallo Bernhard,
da ich NotesRichTextParagraphStyle noch nie verwendet habe (das ist meine erste Erfahrung), ehrlich zu sagen, weiss ich nicht wo sollte das kommen. Da ich nur der Code von Joe Litton - http://joelitton.net angepasst habe, und da ist Call richText.AppendParagraphStyle(rtpStyle) nicht zu finden, verstehe ich auch nicht wo und wie das kommen sollte.
Habe versucht folgendes
For i = 1 To COLUMN_COUNT Step 1
Set tableColStyles(i) = session.CreateRichTextParagraphStyle
Call Body.AppendParagraphStyle(tableColStyles(i))
tableColStyles(i).FirstLineLeftMargin = 0 tableColStyles(i).LeftMargin = 0
ohne Erfolg, es sieht schreklich aus. ???
Man kann natürlich ohne diesen Abstand überleben, da alles anderes OK ist.
Aber, wenn trotzdem es wird mir damit geholfen, werde ich riesig dankbar :)
Den ganzen Code findet man in dem Anhang
http://www.atnotes.de/index.php?PHPSESSID=9f5687d90685229a7f2b1cddbb9c1315&action=dlattach;topic=24293.0;id=2642
Vielen Dank und schöne Gruesse
Sofia
koehlerbv:
Sorry Sofia, ich habe übersehen, dass das ja bereits AppendTable übernimmt ...
Ich muss mal schauen, ob ich dem Problem näherkommen kann.
Bernhard
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln