proasp_howto thread: Background report generation...
A simple implementation is, have the ASP record the user's report request in
a database table, along with any other significant data (report type, email
address etc). Write the actual report generator as an activeX executable.
Then, write a general exe which periodically checks the table for any report
requests. When it finds one, do a call to the ActiveX exe which goes off and
generates/emails the report. ActiveX exe's are handy because they operate in
their own thread space, independant of the client application - basically
its an asynchronous call to the object, while an ActiveX dll operates in the
same space. This allows many reports to be processed at the same time. Once
its finished flag it as complete in the database.
For example, your activex exe would have a sub called
"processReport(requestID)". This will go off and look up the data for
requestID in the database, process the report and then change processed=1.
So you do a call to "processReport()" the activeX exe goes off and does it,
while your main exe carrys on looping doing additional calls as needed.
There are various other ways, but I think this is a straight forward
implementation. It also allows you to run this operation on another server
(which has a connection to the database).
A good article to read is;
From: U K H [mailto:registerukh@h...]
Sent: 09 August 2002 21:26
To: Pro ASP HowTo
Subject: [proasp_howto] Background report generation...
I am creating RTF reports using ASP. Sometimes the reports are so long that
it takes 2-3 mins to generate one or sometimes even more time. And
meanwhile, the user has to just stare at the browser. So, I was thinking how
about the ASP page takes the request for the user and show him a message
saying he will receive his reports by email and let him browser the other
pages of the site and meanwhile, I want some background process to kick
start this report generating code. So, I was wondering what is the best way
of starting this report generating code (will be written in VB6) as soon as
the ASP page receives the request from the user.
Any pointers will be appreciated.
Send and receive Hotmail on your mobile device: http://mobile.msn.com