home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 May
/
W2KPRK.iso
/
apps
/
crystal
/
disk8
/
report.as_
/
report.as
Wrap
Text File
|
1999-08-23
|
3KB
|
98 lines
<%
' Get QS variables
rpttoview = request.querystring("rpt")
viewer = request.querystring("init")
'build full path for report
rpttoview = MID(request.ServerVariables("PATH_TRANSLATED"), 1, (LEN(request.ServerVariables("PATH_TRANSLATED"))-11)) & "\craze\" & rpttoview & ".rpt"
' build path to MDB
pathtomdb = MID(request.ServerVariables("PATH_TRANSLATED"), 1, (LEN(request.ServerVariables("PATH_TRANSLATED"))-19)) & "\craze.mdb"
' Only create the Crystal Application Object on first time through
If Not IsObject ( session ("oApp")) Then
Set session ("oApp") = Server.CreateObject("Crystal.CRPE.Application")
End If
' Turn off all Error Message dialogs
Set oGlobalOptions = Session ("oApp").Options
oGlobalOptions.MorePrintEngineErrorMessages = 0
' Open the report
Set session("oRpt") = session("oApp").OpenReport(rpttoview)
' Turn off sepecific report error messages
Set oRptOptions = Session("oRpt").Options
oRptOptions.MorePrintEngineErrorMessages = 0
' now set the table location
Set oDB = session("oRpt").Database
For Each oDBTable In oDB.Tables
oDBTable.Location = pathtomdb
Next
' Opening the page engine will cause the data to be read
Set session("oPageEngine") = session("oRpt").PageEngine
' Now decide what viewer to create
Select Case viewer
Case "java"
%>
<SCRIPT LANGUAGE="JavaScript"><!--
var _ns3 = false;
var _ns4 = false;
//--></SCRIPT>
<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
var _info = navigator.userAgent;
var _ns3 = (navigator.appName.indexOf("Netscape") >= 0 && _info.indexOf("Win16") < 0 && _info.indexOf("Mozilla/3") >= 0);
var _ns4 = (navigator.appName.indexOf("Netscape") >= 0 && _info.indexOf("Win16") < 0 && _info.indexOf("Mozilla/4") >= 0 );
//--></SCRIPT></COMMENT>
<SCRIPT LANGUAGE="JavaScript"><!--
if(_ns3==true)
document.writeln( '<applet code=com.seagatesoftware.img.ReportViewer.ReportViewer codebase="/viewer/JavaViewer" id=ReportViewer width=100% height=95% archive="/viewer/JavaViewer/ReportViewer.zip">' );
else if (_ns4 == true)
document.writeln( '<applet code=com.seagatesoftware.img.ReportViewer.ReportViewer codebase="/viewer/JavaViewer" id=ReportViewer width=100% height=95% archive="/viewer/JavaViewer/ReportViewer.jar">' );
else
document.writeln( '<applet code=com.seagatesoftware.img.ReportViewer.ReportViewer codebase="/viewer/JavaViewer" id=ReportViewer width=100% height=95% >' );
//--></SCRIPT>
<param name=ReportName value="rptserver.asp">
<param name=HasGroupTree value=true>
<param name=ShowGroupTree value=true>
<param name=HasRefreshButton value=true>
<param name=HasPrintButton value=true>
<param name=cabbase value="/viewer/JavaViewer/ReportViewer.cab">
</applet>
<%
Case "actx"
%>
<OBJECT ALIGN = LEFT ID="CRViewer" WIDTH=100% HEIGHT=95%
CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
CODEBASE="/viewer/activeXViewer/CRViewer.dll#Version=1,2,0,30">
<PARAM NAME="Report Name" VALUE="rptserver.asp">
<PARAM NAME="Show Group Tree" VALUE= 1>
<PARAM NAME="Show Toolbar" VALUE= 1>
</OBJECT>
<%
Case "html_frame"
response.redirect "htmstart.asp"
Case "html_page"
response.redirect "rptserver.asp"
end select
%>