Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display a "Please wait..." message

Status
Not open for further replies.

LV

Programmer
Nov 1, 2000
1,184
0
0
US
I have a report that takes a while to process. It opens in a separate window so users have to watch a white screen for up to 2 min. I need to show some "Please wait..." message during this process. Everything is done on the same page so I can't use anything like this:

<%
response.buffer = true
Response.Write &quot;Building report...&quot;
response.flush

'Calculations goes here
%>

<html>
<head>
<meta http-equiv=&quot;Refresh&quot; content=&quot;2; URL=result.asp&quot;>
</head>
</body>
</html>

because there is no result.asp in my case, I have to be on this page.
Any ideas?
Thanks in advance.
L.V.
 
I use the following
Code:
<script language=&quot;JavaScript&quot;>
alert(&quot;\n_________________________\n\n&quot; +
      &quot;     Your report is processing...\n&quot; +
      &quot;_________________________\n\n&quot; +
      &quot;     Please be patient.&quot;);
</script>

Steven Fowler
steven_m_fowler@yahoo.com
 
Hi Steven,
Thanks for the reply.
What I need to do is to display an HTML text which will disappear as soon as the report process is done. In this case, a user will have to click OK on the message box and then still watch a white screen for a while. Any other ideas?
Thanks again.
 
Here you go:
Code:
<!-- THREE STEPS TO INSTALL PRELOAD PAGE:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the onLoad event handler into the BODY tag
  3.  Put the last coding into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!-- Begin
function loadImages() {
if (document.layers) {
document.hidepage.visibility = 'hidden';
}
else {
document.all.hidepage.style.visibility = 'hidden';
   }
}
//  End -->
</script>
</HEAD>

<!-- STEP TWO: Insert the onLoad event handler into your BODY tag  -->

<BODY OnLoad=&quot;loadImages()&quot;>

<!-- STEP THREE: Copy this code into the BODY of your HTML document  -->

<div id=&quot;hidepage&quot; style=&quot;position: absolute; left:5px; top:5px; background-color: #FFFFCC; layer-background-color: #FFFFCC; height: 100%; width: 100%;&quot;> 

<table width=100%><tr><td>Report loading ... Please wait.</td></tr></table></div> 

<!-- put the rest of your page contents here -->

<p><center>
<font face=&quot;arial, helvetica&quot; size=&quot;-2&quot;>Free JavaScripts provided<br>
by <a href=&quot;[URL unfurl="true"]http://javascriptsource.com&quot;>The[/URL] JavaScript Source</a></font>
</center><p>

<!-- Script Size:  1.20 KB -->
Steven Fowler
steven_m_fowler@yahoo.com
 
Tried that, and it still doesn't work.
To be more clear, here is what I'm doing. It's actually pretty close to Seagate ASP samples.

<%@ Language=VBScript %>

<%
Response.Buffer = true

ReportName = &quot;reports/customer.rpt&quot;
Path = Request.ServerVariables(&quot;PATH_TRANSLATED&quot;)

Path = Request.ServerVariables(&quot;PATH_TRANSLATED&quot;)

While (Right(Path, 1) <> &quot;\&quot; And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend

On Error Resume Next
If not IsObject (session(&quot;oApp&quot;)) Then
Set session (&quot;oApp&quot;) = Server.CreateObject(&quot;CrystalRuntime.Application&quot;)
End If

Call session(&quot;oApp&quot;).SetMorePrintEngineErrorMessages(0)
Call session(&quot;oApp&quot;).SetMatchLogonInfo(1)

If IsObject(session(&quot;oRpt&quot;)) then
Set session(&quot;oRpt&quot;) = nothing
end if

Set session(&quot;oRpt&quot;) = session(&quot;oApp&quot;).OpenReport(Path & ReportName,1)

session(&quot;oRpt&quot;).DiscardSavedData
session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = false

On Error Resume Next
session(&quot;oRpt&quot;).ReadRecords

If Err.Number <> 0 Then
Response.Write &quot;An Error has occured on the server in attempting to access the data source&quot; & &quot;<BR>&quot;
Response.Write &quot;Number - &quot; & Err.number & &quot;<BR>&quot;
Response.Write &quot;Description - &quot; & Err.Description & &quot;<BR>&quot;
Response.Write &quot;Source - &quot; & Err.Source & &quot;<BR>&quot;

If IsObject(session(&quot;oPageEngine&quot;)) Then
set session(&quot;oPageEngine)&quot;) = nothing
End If
Else
If IsObject(session(&quot;oPageEngine&quot;)) Then
set session(&quot;oPageEngine)&quot;) = nothing
End If
set session(&quot;oPageEngine&quot;) = session(&quot;oRpt&quot;).PageEngine
End If

<!-- #include file=&quot;SmartViewerActiveX.asp&quot; -->

When I include your code into SmartViewerActiveX.asp after the <OBJECT> tag, the process stops at that line. If included after <OBJECT>, then it ignores it.
Any other way of doing that?
Thanks,
L.V.

 
You are going to know a little about JavaScript and VBScript. I can not train you....

I have not tested the code but it should look like this...

Code:
<HTML>
<HEAD>
<TITLE>Seagate ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD=&quot;Page_Initialize&quot;>
<div id=&quot;hidepage&quot;> 
	<table width=100%><tr><td>Report loading ... Please wait.</td></tr></table>
</div> 
<OBJECT ID=&quot;CRViewer&quot;
	CLASSID=&quot;CLSID:C4847596-972C-11D0-9567-00A0C9273C2A&quot;
	WIDTH=100% HEIGHT=95%
	CODEBASE=&quot;/viewer/activeXViewer/activexviewer.cab#Version=8,0,0,224&quot;>
<PARAM NAME=&quot;EnableRefreshButton&quot; VALUE=1>
<PARAM NAME=&quot;EnableGroupTree&quot; VALUE=1>
<PARAM NAME=&quot;DisplayGroupTree&quot; VALUE=1>
<PARAM NAME=&quot;EnablePrintButton&quot; VALUE=1>
<PARAM NAME=&quot;EnableExportButton&quot; VALUE=1>
<PARAM NAME=&quot;EnableDrillDown&quot; VALUE=1>
<PARAM NAME=&quot;EnableSearchControl&quot; VALUE=1>
<PARAM NAME=&quot;EnableAnimationControl&quot; VALUE=1>
<PARAM NAME=&quot;EnableZoomControl&quot; VALUE=1>
</OBJECT>

<SCRIPT LANGUAGE=&quot;VBScript&quot;>
<!--
Sub Page_Initialize
	if (document.layers) then
                'Netscape
		document.hidepage.visibility = 'hidden'
	else
                'IE
		document.all.hidepage.style.visibility = 'hidden'
	end if
	Dim webBroker
	Set webBroker = CreateObject(&quot;WebReportBroker.WebReportBroker&quot;)
	if ScriptEngineMajorVersion < 2 then
		window.alert &quot;IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site.&quot;
		CRViewer.ReportName = Location.Protocol + &quot;//&quot; + Location.Host + &quot;/scrsamples/Web Component Server/rptserver.asp&quot;
	else
		Dim webSource
		Set webSource = CreateObject(&quot;WebReportSource.WebReportSource&quot;)
		webSource.ReportSource = webBroker
		webSource.URL = Location.Protocol + &quot;//&quot; + Location.Host + &quot;/scrsamples/Web Component Server/rptserver.asp&quot;
		webSource.PromptOnRefresh = True
		CRViewer.ReportSource = webSource
	end if
	CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</BODY>
</HTML>
Steven Fowler, Principal
steve.fowler@fowlerconsulting.com
- Development, Training, and Consulting
wpe1.gif
 
Yep, I have tested that
(by including document.all.hidepage.style.visibility = &quot;hidden&quot; line into Page_Initialize sub and &quot;Report Loading...&quot; part after the
<BODY> tag)
before I posted my last message and it didn't work.
Well, may be it will start working after I learn more javascript and vbscript... but so far it does not.
Thanks anyways.
 
The issue is...
How does the browser inturput the <Object tag in relation to the <DIV> tag?
I am not sure.

I would think with enough tweeking you could get it to work.

Steven Fowler
 
Solved, a little different, but works fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top