Simple LN+web application

Session greetings!

First of all I’m totally newbie in a www development in LN (there are however

experience in LN development) and now I’ve encountered with the following

task:

It is a database which is accessible from LN6.5 and web. Kind of names.nsf but with additional fields that my boss wants to see. There should be

  • search form (by surname) and after a user enters a surname and click

“Search” button:

if there is one match → display employee card

if there are more than one match → display links list to go to the employee

document

  • search form (by department)

there must be 3 comboboxes. The sens here is that we have 3 levels of

hierarchy, so one field for each level. When user chose the highest level in

the second field list must be refreshed to allow chose only appropriate

sublevels. The same for the level2.

There are also different views she wants me to implement (guess I can handle

all of this) but she also wants me to create a export procedure (to MS Excel

that works on web). I have no idea how to do that.

General interface - 3 frame

=================================

++++++++||++++++++++++++++++++++||

++++++++||+++++++++3F+++++++++++||

++++++++||++++++++++++++++++++++||

++++++++||======================||

+++1F+++||++++++++++++++++++++++||

++++++++||++++++++++++++++++++++||

++++++++||+++++++++2F+++++++++++||

++++++++||++++++++++++++++++++++||

=================================

1F must have outlines with links to all views

2F must have a search forms (1 for surname and 1 for hierarchy search)

3F must have an employee form.

Any pointer to a real database with such basic, but for-me-no-idea-how-to-do functions would be a saver for me.

I especially would like to know

  • how to do MS Excel export procedure on a web

  • how to do fields dependency on a web (working example greatly appreciated)

  • how to do open-employee-card-in-the-frame-below trick.

Thank all of you who’ve read down to this line.

Subject: Simple LN+web application

Zdrastvwootchya, Here is the export to Excel part, which I copied from someone years ago. Put this in an agent. Have an “Export” button run the agent with a URL command.

’ declare Notes objects

Dim session As New NotesSession

Dim view As NotesView

Dim db As NotesDatabase

Dim agent As NotesAgent

Dim doc As NotesDocument

’ find out the current database, agent and CGI variables

Set db=session.CurrentDatabase

Set context=session.DocumentContext

Set agent=session.CurrentAgent





Set view = db.GetView("Export")

’ switch off http header

Print "Content-Type:application/vnd.ms-excel"

’ Open HTML Table

Print "<TABLE BORDER=1 CELLPADDING=2>"

’ Display header row, counting each column as displayed

Print "<TR>"

ColCount%=0

Forall Col In view.Columns

	If Not col.IsHidden Then

		ColCount%=ColCount%+1

		Print "<TH>"+col.Title

	End If

End Forall

’ Create array for holding Column Totals

Redim Totals(1 To ColCount%)

’ Scan thru all documents in view

RowCount%=0     

Set doc=view.GetFirstDocument     

While Not (doc Is Nothing)

	RowCount%=RowCount%+1

	Print "<TR>"

	ColNum%=0

’ Output each cell of the row

	Forall cell In doc.ColumnValues

		ColNum%=ColNum%+1

’ Total and right-align numbers

		If Typename(cell)="DOUBLE" Then

			Print "<TD ALIGN=RIGHT>"

			Totals(ColNum%)=Totals(ColNum%)+1

		Else

			Print "<TD>"

		End If

’ Output cell value

		Print cell

	End Forall

’ Get next row of view

	Set doc=View.GetNextDocument(doc)                     

Wend

’ finish off table

Print "</TABLE>"

Subject: RE: Simple LN+web application

Hello Greg!Thank you for a response! I’ve tried to do this and here is what I do

Internet Explorer

on the LD console I’ve got an output

06.04.2005 09:47:25 HTTP Web Server: Lotus Notes Exception - Unsupported trigg

er and search in the background or embedded agent [/ot/otnames.nsf/Excel?openage

nt]

Sure I didn’t do or missing something else?

Subject: RE: Simple LN+web application

Ok! Guess I’ve found what was wrong. Changed agent trigger on Runtime=Agent list selection and Target=none and it works now! Thank you Greg!

And how we can pass to an agent a view name (to make it work on different views)?

renew… Think that Query_String is what I was looking for.