Link to home
Start Free TrialLog in
Avatar of DominoDev
DominoDev

asked on

Lotus notes categorized view and export to rich text field

Hello I would like to import lotus notes categorized view to rich text field using lotus script, the view has below kind of structure

pass
    --> jon 60%
   --> Maya 65
  ---> Deji
Fail
     --> Rynci 53%
     etc...

Now I want using lotusscript I want to create a rich text report with richtexttable, please note that the categorized are unknow I want all categories to be exported, above is just an example.

The end report would be of category wise.
Avatar of DominoDev
DominoDev

ASKER

counter = 0
      Set entry = nav.GetFirst
      While Not(entry Is Nothing)
            If Not entry.IsCategory Then
                  If entry.IsDocument Then
                        Set doc=entry.document
                  End If
            Else
                  
                  Dim dataRTItem As NotesRichTextItem
                  Set dataRTItem = New NotesRichTextItem(NewReportDoc, "Data" & counter )
            
                  Set rtnav = dataRTItem.CreateNavigator
                  Set rstyle=session.CreateRichTextStyle
                  
                  'heading in the body section of the mail
                  rstyle.Bold=True
                  rstyle.NotesColor=COLOR_RED
                  rstyle.Underline=True
                  rstyle.NotesFont=FONT_COURIER
                  rstyle.FontSize=8
                  Call dataRTItem.AppendStyle(rstyle)
                  rstyle.Underline=False
                  rstyle.NotesColor=COLOR_BLACK
                  dataRTItem.AddNewline(2)
                  rstyle.FontSize=10
                  rstyle.Bold=False
                  rstyle.NotesColor=COLOR_BLACK
                  Call dataRTItem.AppendStyle(rstyle)
                  rows=entry.Descendantcount + 1
                  MsgBox rows & ", " & cols
                  Call dataRTItem.AppendTable(rows,cols,, RULER_ONE_INCH * 0.00001 )
                  Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL)
                  'heading of the table
                  rstyle.Bold=True
                  rstyle.NotesColor=COLOR_BLUE
                  rstyle.FontSize=6
                  Call dataRTItem.AppendStyle(rstyle)
                  For i=0 To UBound(ReportHeader)
                        Call dataRTItem.BeginInsert(rtnav)
                        Call dataRTItem.AppendText(ReportHeader(i))
                        Call dataRTItem.EndInsert
                        Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
                  Next
            
                  counter = counter +1
            End If
            Set entry = nav.GetNext(entry)
      Wend
I want to create report for the user based on available category in the view. if there are four categories in view there has to be 4 richtext box and each should have data in that richtext fields. richtext field has to be created on fly.
Avatar of Sjef Bosman
May I advise you to produce your report first without the table stuff, so you get your logic right? The code above isn't finished, I suppose. Handling elements inside a NotesRichTextItem is quite complicated, so you should leave that for the second stage of this project. And why do you want to produce multiple rich text items? If you want to display those items on the screen, you must have at least the same number of correctly named rich text fields in a form. What if your code produces 45 rich text items, will you have 45 fields in your form??

Make your code work for an ordinary rich text field, then go for the details.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.