Show data on the web

Hi,

how can I show data colected with an LotusScript agent in the browser!

Help

Thanks

Subject: Show data on the web

Hi Brane

You can use the Print command.

Example:

Print “

Result from Agent

”

…

do while not doc is nothing

…

Print “

” + doc.Subject(0) + “

”

…

HTH Bodo

Subject: RE: Show data on the web

A little problem occured when i run this code i get a new page where stands Result from Agent

but the view is 100% correct!

Why

Dim s As New notessession

Dim db As notesdatabase

Dim vw As notesview

Dim curdoc As notesdocument

Dim vwdoc As notesdocument

Dim brojugovora As String

Dim username As String

Dim password As String



Set db = s.GetDatabase("myser","mybase")

If db Is Nothing Then

	Print "<H1>Nemogu otvoriti bazu!</H1>"

	Exit Sub

End If



Print "<H1>Result from Agent</H1>"

Set vw = db.getview("WICRnlg") 

If vw Is Nothing Then

	Print "<H1>"Nemogu pristupiti radnim nalozima" </H1>"

	Exit Sub

End If

Print "<H1>Result from Agent2</H1>"



Set curdoc = s.documentcontext







If curdoc.BrjRnlg(0) = "" Then Exit Sub 







Set vwdoc = vw.getdocumentbykey(curdoc.BrjRnlg(0))

If vwdoc Is Nothing Then

	Print "<H1>Nemogu pronaci radni nalog s tim brojem</H1>"

	Exit Sub

End If

Subject: RE: Show data on the web

If the agent cannot get a handle to curdoc or the field doesn’t exist, it will fail.

I think you’d best replace:

If curdoc.BrjRnlg(0) = “” Then Exit Sub

With:

Dim BrjRnlgvalue as Variant

Set BrjRnlgvalue = curdoc.GetFirstItem ( “BrjRnlg” )

If BrjRnlgvalue is nothing then Exit Sub

If BrjRnlgvalue(0) = “” then Exit Sub

Hope that helps,

Dave Navarre

Chub Toad

Subject: RE: Show data on the web

Hi,

You can debug the code by giving messagebox after the view or by placing error handler. This will prompt in the log.nsf or server console. you can also debug the agent by Print statement.

Subject: RE: Show data on the web

That is what i am doing(debug with print) it goes ok in client but in browser it wont work. It seems that it stops on or after the view statement.

Heeeeeeeeelp

Subject: RE: Show data on the web

“msgbox” will output the information to domino server console in web. In client, it will alert the user.

Print will write the information to the web page. So, use msgbox to debug.

What I am guessing which could cause error is -

set curdoc = s.documentcontext

I think curdoc is not set to the document context. I may be wrong with the above line of code Brane, but documentcontext will run correctly if the agent runs from WebQueryOpen and WebQuerySave but not on click of button (if I am correct).

Try it out using “msgbox” function in middle of agent and run it to see the statements on domino console.

HTH

–Phani