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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this a Javascript , ASP or Crystal Reports Query ?? ?

Status
Not open for further replies.

welshone

Programmer
Jul 30, 2001
414
GB
Hello,

I am using the following script when a page opens to show the users that they have to wait for a report to load.
This script works fine only all other things, but for some reason when used with crystal reports the report is not shown ?

How can I get this to work ?

<SCRIPT Language=Javascript>
function HideHourGlass(){
szNavVersion = navigator.appVersion // Hide the 'retreiving records' display
if (szNavVersion.indexOf (&quot;4.&quot;) >= 0 || szNavVersion.indexOf (&quot;5.&quot;) >= 0) {
if (navigator.appName == &quot;Netscape&quot;){
document.layers[&quot;StatusText&quot;].visibility=&quot;hide&quot;
}else{
if (document.all(&quot;StatusIE&quot;)){
document.all(&quot;StatusIE&quot;).style.visibility = &quot;hidden&quot;;
}
}
}
}
</SCRIPT>
<BODY onLoad=&quot;HideHourGlass()&quot;>
<DIV ID=&quot;StatusIE&quot;><LAYER ID=&quot;StatusText&quot;><center>Generating Report, Please Wait... </center></LAYER></DIV>


thanks in asvance.
 
to anser your question how to get this to work...this is script that realy has nothing to do with reports or anything...it is really just finding the type of browser and displaying some test....maybe it doens't work with CR cause it never gets to this script??THe report doesn't show or the &quot;please wait...&quot; doesn't show?

post the file that uses the CR code as well.....

CS ***************
***************
 
This is the whole File :

<%@ LANGUAGE=&quot;VBSCRIPT&quot; %>
<title>A001</title>

<%

reportname = &quot;A001.01 Admissions Extract.rpt&quot;

%>

<SCRIPT Language=Javascript>
function HideHourGlass(){
szNavVersion = navigator.appVersion // Hide the 'retreiving records' display
if (szNavVersion.indexOf (&quot;4.&quot;) >= 0 || szNavVersion.indexOf (&quot;5.&quot;) >= 0) {
if (navigator.appName == &quot;Netscape&quot;){
document.layers[&quot;StatusText&quot;].visibility=&quot;hide&quot;
}else{
if (document.all(&quot;StatusIE&quot;)){
document.all(&quot;StatusIE&quot;).style.visibility = &quot;hidden&quot;;
}
}
}
}
</SCRIPT>
<BODY onLoad=&quot;HideHourGlass()&quot;>
<DIV ID=&quot;StatusIE&quot;><LAYER ID=&quot;StatusText&quot;><center>Generating Report, Please Wait... </center></LAYER></DIV>


<%

If Not IsObject (session(&quot;oApp&quot;)) Then
Set session(&quot;oApp&quot;) = Server.CreateObject(&quot;Crystal.CRPE.Application&quot;)
End If


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


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)


Set oRptOptions = Session(&quot;oRpt&quot;).Options
oRptOptions.MorePrintEngineErrorMessages = 0
session(&quot;oRpt&quot;).DiscardSavedData
%>


<%

userid = &quot;ed&quot;
password = &quot;ed&quot;


'session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = False
'session(&quot;oRpt&quot;).EnableParameterPrompting = False

' Set the location
set crtable = session(&quot;oRpt&quot;).Database.Tables.Item(1)
crtable.SetLogonInfo &quot;Holding&quot;, &quot;Holding&quot;, cstr(userid), cstr(password)

%>

<%

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;
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

%>


<HTML>
<HEAD>
<TITLE>Seagate ActiveX Viewer</TITLE>
</HEAD>

<script>
parent.resizeTo(800, 600);
</script>




<input type=&quot;button&quot; value=&quot; Close Report &quot; OnClick=&quot;document.location='./Default.htm';return false;&quot; id=button1 name=button1>

<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD=&quot;Page_Initialize&quot;>

<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=2,2,4,28&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
On Error Resume Next
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 =&quot;rptserver.asp&quot;
else
Dim webSource
Set webSource = CreateObject(&quot;WebReportSource.WebReportSource&quot;)
webSource.ReportSource = webBroker
webSource.URL = &quot;rptserver.asp&quot;
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>

</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top