Problem with ColumnValues

Hi

I am facing problem with the agent with ColumnValues. Please look into the code.

Sub Initialize

Dim s As New notessession

Dim db As notesdatabase

Dim view As notesview

Dim doc As notesdocument

Dim dc As NotesDocumentCollection



Dim lists(1 To 200) As Variant

Dim ab As Variant





counter = 1

Set db=s.CurrentDatabase

Set doc1=s.DocumentContext

ecode=getQryStrValue( doc1.Query_String_Decoded(0), "key=" )

Set view=db.GetView("ProjectMaster")



Set dc = view.GetAllDocumentsByKey(ecode, False)

Set doc=dc.GetFirstDocument



While Not (doc Is Nothing)

	lists( counter )=doc.ColumnValues( 10 )

	sHTML="<style type='text/css'>td.sample{	padding : 2px;	font : normal 9pt Verdana,  Arial, sans-serif;	border-color : #CECFCE #CECFCE #CECFCE #CECFCE;	border-style : solid;	border-top-width : 2px;	border-right-width : 2px;	border-bottom-width : 2px;	border-left-width : 2px;	background-color : rgb(239,239,239);	}</style><table class='sample' width='100%'><tbody>"+lists( counter ) +"</tbody></table> "

	Print sHTML

	Set doc = dc.GetNextDocument( doc )

	counter = counter + 1

	

	

Wend



'Print "<input type='button' value='Add Project' onClick='javascript:loginCheck();'>"

End Sub

It is not giving me the result. Tell me other alternative if have.

Thanks for help

Subject: Problem with ColumnValues

kqaurav,

Two thoughts:

  1. I would use & instead of +, as you are performing string concatenation, not addition.

  2. Also, note that doc.ColumnValues ( 10 ) might be an array itself. So you should check for that condition, and, if an array, convert into a string appropriately for your use.

regards,

raphael

Subject: Problem with ColumnValues

Your code will fail here:lists( counter )=doc.ColumnValues( 10 )

You must use NotesViewEntryCollection instead of NotesDocumentCollection. Then, get an Entry, then from that you can access all the columnvalues…