Display message for long running server logic

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay, here is what I am trying to do

We have a dialog of windows that collects information for generation of a dynamic HTML report. The last page in the wizard dialog accepts all report options (in XML format) and calls a business tier object in the pageLoad event, which creates the HTML report file. This file is then streamed to the client

This process works well, and whilst we have tuned it to death it still takes between 1-5 seconds based on its size

I would like a 'Report is being generated' type of message to be displayed whilst the report generation logic is running in the middle tier. Given the way the solution is architected I am not sure how to do this, or even if it is possible

My initial thought was to have the initial state of the page displaying the appropriate message. Then in the client side pageLoad event triggers a postback, which would perform the report generation logic. Once complete the report would be streamed to the client

Any help here would be wonderful..

GB
 
You could display a 'Report is being generated' message to the user and set a session variable on the page. The page would keep refreshing until that session variable had changed, then would take the user to the appropriate page (or just show and hide the appropriate control).
 
How would you periodically refresh the page? The refresh would have to be initiated from the client wouldn't it?
 
SetInterval script function can be used to execute a script function (client side) after specific intervals. From within this function, you can pass a call to the server to check if the report generation is complete. but this actually depends on how your implementation is

hope this help

Augustin
 
If you make sure buffering is off you could output JavaScript messages to
the client which update a progress bar, we use a similar technique with an
online newsletter mailing system
http://www.3internet.com/products/Inigo/mailshooter.aspx

You could use a table with an image in it acting as your progress bar.

You would then simple output some JavaScript such as....
<SCRIPT>
var maxImageWidth = 400;

function updateProgress(prcntge) {
// Change the size of the image with the name progressImage (or use
id=progressImage and document.getElementById("progressImage"))
document.images["progressImage"].width = (prcntge/100) * maxImageWidth;
//
// you could also update a text field to show percentage completion in a
similar way
//
}
</SCRIPT>

Then you would output subsequent script blocks as you process runs giving a
percentage completion, you can output as many of these as you would like....

<SCRIPT>
updateProgress(10);
</SCRIPT>

When the process has completed you could either hide the table by setting
the display style property to none, or you could simply redirect to the
generated page using javascript (that's assuming that page generates a hard
copy to redirect to)

Matt
http://www.3internet.com



GB said:
Okay, here is what I am trying to do.

We have a dialog of windows that collects information for generation of a
dynamic HTML report. The last page in the wizard dialog accepts all report
options (in XML format) and calls a business tier object in the pageLoad
event, which creates the HTML report file. This file is then streamed to
the client.
This process works well, and whilst we have tuned it to death it still
takes between 1-5 seconds based on its size.
I would like a 'Report is being generated' type of message to be displayed
whilst the report generation logic is running in the middle tier. Given the
way the solution is architected I am not sure how to do this, or even if it
is possible.
My initial thought was to have the initial state of the page displaying
the appropriate message. Then in the client side pageLoad event triggers a
postback, which would perform the report generation logic. Once complete
the report would be streamed to the client.
 
Back
Top