Hi all
When a user runs a report on my database it basically exports all the details to excel with the defined formatting.
The problem is for some of the larger reports this is now taking 10 minutes to run, and will only get larger. The database is a timesheet/project management application, so there are loads of docs in it to go through to export.
I’m constantly looking for ways to speed up the reporting, and one thing I figured might work would be to let the notes client run an agent in the background, which then emailed the results of the report to the user. Seems fair enough to me.
So, using the notesagent.runonserver method I figured this would run the agent on the server, freeing up the notes client. But no, the agent still hangs the notes client up for exactly the same amount of time (not scientifically tested, but for a long time anyway).
Is there are way I can set this agent to simply run on the server, not using the notes client at all? I know I can set the agent to be scheduled, but I don’t really want an agent scheduled to run every few minutes, and users don’t want to wait for an hour or more for their report.
Cheers
Dan
Subject: running an agent without hanging the notes client
I’ve done something similar which was basically:
Add a button e.g., [Request Report] in the database. This button sends an e-mail to a mail-In database. The mail in database runs an agent on new e-mails arriving which generates the report and e-mails it back to the user.
Subject: Sounds exactly what I was looking for, thanks!
I’ll post back if I get into problems
Cheers
Dan
Subject: RE: Sounds exactly what I was looking for, thanks!
If the user is off line this obviously won’t work. And if the server is loaded the process may take a little longer than the user is prepared to wait. They press the button again and again and again and again … then complain when they get 5 copies of the same report and wonder why it took so long!
Subject: RE: Sounds exactly what I was looking for, thanks!
That’s fair enough - we don’t have many off-line workers, and I’m thinking about giving them options, ie a ‘Run Now’ and ‘Run in Background’ button. A bit more coding, but probably worth it.
Dan
Subject: RE: Sounds exactly what I was looking for, thanks!
Hi,
an other way how to run an agent in the background is to send the server console command “tell amgr run “xxx.nsf” ‘Agentname’” to the server.
Look in the NotesSession-Object for the method “SendConsoleCommand”.
(You will still need to use an agent and trigger it with “RunOnServer” because you will want to run with higher access-rights, which are allowed to send commands to the console.)
However this will be the fastest method how to trigger the action while not blocking the client.
Bye
Hynek
PS: Of course this wont work locally. :-))
Subject: RE: Sounds exactly what I was looking for, thanks!
Thanks Hynek, that’s an interesting one as well, I 'll try it out.
Dan