NotesViewColumn.IsHidden ?
Public Class IsViewColumnHide
Public ColumnIsHide() As boolean
Public ColumnIsHideFormula() As String
%REM
Sub New
Description: Comments for Sub
%END REM
Sub New(view As NotesView)
ReDim ColumnIsHide(view.Columncount)
ReDim ColumnIsHideFormula(view.Columncount)
Dim nc As NotesNoteCollection
Dim s As New NotesSession
Dim ex As NotesDXLExporter
Dim par As NotesDOMParser
Dim db As NotesDatabase
Dim k As Integer,ret As Variant
Set db=view.Parent
Set nc =db.CreateNoteCollection(False)
Call nc.Add(view)
Set ex = s.CreateDXLExporter(nc)
Set par =s.CreateDOMParser(ex)
On Event PostDOMParse From par Call ExtractHideColumns
Call ex.Process
For k=0 To Ubound(ColumnIsHide)
If ColumnIsHideFormula(k)<>"" then
ret=Evaluate(ColumnIsHideFormula(k))
ColumnIsHide(k)=(ret(0)="1")
End if
Next
End Sub
Private Sub ExtractHideColumns(Source As NotesDOMParser)
Dim colNodeList As NotesDOMNodeList
Dim colNode As NotesDOMElementNode
Dim codeNodeList As NotesDOMNodeList
Dim codeNode As NotesDOMElementNode
Dim pnode As NotesDOMElementNode
Dim x,y
Set colNodeList=Source.Document.GetElementsByTagName("column")
For x=1 To colNodeList.NumberOfEntries
Set colNode=colNodeList.GetItem(x)
Set codeNodeList=colNode.Getelementsbytagname("formula")
For y=1 To codeNodeList.Numberofentries
Set codeNode=codeNodeList.GetItem(y)
Set pnode=codeNode.Parentnode
If pnode.Getattribute("event")="hidewhen" Then
ColumnIsHideFormula(x-1)=codeNode.Firstchild.Nodevalue
End If
Next
Next
End Sub
End Class
передать какой-то док из БД?
Добавлено: тот же профайл получить и передать, например?
Контекстная БД для Evaluate определяется по переданному контекстному документу. Т.е. создайте в конкретной БД пустой NotesDocument, не сохраняя, и укажите в качестве параметра в Evaluate
Public Class IsViewColumnHide
Public ColumnIsHide() As boolean
Public ColumnIsHideFormula() As String
Sub New(view As NotesView)
ReDim ColumnIsHide(UBound(view.Columns))
ReDim ColumnIsHideFormula(UBound(view.Columns))
Dim nc As NotesNoteCollection
Dim s As New NotesSession
Dim ex As NotesDXLExporter
Dim par As NotesDOMParser
Dim db As NotesDatabase
Dim k As Integer,ret As Variant
Dim tmpdoc As NotesDocument
Set db=view.Parent
Set tmpdoc=db.Createdocument()
Set nc =db.CreateNoteCollection(False)
Call nc.Add(view)
Set ex = s.CreateDXLExporter(nc)
Set par =s.CreateDOMParser(ex)
On Event PostDOMParse From par Call ExtractHideColumns
Call ex.Process
For k=0 To Ubound(ColumnIsHide)
ColumnIsHide(k)=view.Columns(k).IsHidden
If Not ColumnIsHide(k) And ColumnIsHideFormula(k)<>"" then
ret=Evaluate(ColumnIsHideFormula(k),tmpdoc)
ColumnIsHide(k)=(ret(0)="1")
End if
Next
End Sub
Private Sub ExtractHideColumns(Source As NotesDOMParser)
Dim colNodeList As NotesDOMNodeList
Dim colNode As NotesDOMElementNode
Dim codeNodeList As NotesDOMNodeList
Dim codeNode As NotesDOMElementNode
Dim pnode As NotesDOMElementNode
Dim x as integer,y as integer
Set colNodeList=Source.Document.GetElementsByTagName("column")
For x=1 To colNodeList.NumberOfEntries
Set colNode=colNodeList.GetItem(x)
Set codeNodeList=colNode.Getelementsbytagname("formula")
For y=1 To codeNodeList.Numberofentries
Set codeNode=codeNodeList.GetItem(y)
Set pnode=codeNode.Parentnode
If pnode.Getattribute("event")="hidewhen" Then
ColumnIsHideFormula(x-1)=codeNode.Firstchild.Nodevalue
End If
Next
Next
End Sub
End Class
Взломай свой первый сервер и прокачай скилл — Начни игру на HackerLab