petergroves
asked on
Another parameter passing problem with ASP
This is the code from my page . I am totally new to web based crystal .
I'm using Crystal 10 advanced .
What is happening is that the page opens but is missing the dynamic data . But all the static field labels are there.
I'm wondering if its not due to the colon in the data I'm passing . The parameter in the report is asset_ctag .
There are 2 ways to pass parameters , 1 is by indexed parameters and the other is by named parameters .
I haven't seen ant reference to the named process. There is only 1 parameter in my report.
If I run the discrete parameter asp sample it works ok.
========================== ========== ========== ========== ========== ========== ========== ========
<%@ LANGUAGE="VBSCRIPT" %>
<%
'========================= ========== ========== ========== ========== ========== ===
' WORKING WITH THE REPORT DESIGNER COMPONENT AND ASP TO LOG IN TO A MAIN REPORT
'========================= ========== ========== ========== ========== ========== ===
'
' CONCEPT
'
' ALWAYS REQUIRED STEPS (contained in AlwaysRequiredSteps.asp)
' - create the application object
' - create the report object
' - open the report
'
' WORKING WITH ConnectionProperty Object
' The ConnectionProperty Object is a property bag that stores connection
' information for the report. Information is dependent on the Crystal Decisions
' database DLL used by the report and the database drivers that support the DLL.
' The collection of ConnectionProperty objects can hold common properties defined
' in our database DLLs, connection properties from the supporting drivers, or
' both. For example a report based off an OLEDB (ADO) connection to Microsoft SQL
' Server will contain properties supplied by the database DLL (crdb_ado.dll) such
' as Provider, Data Source, Initial Catalog, User ID, and Password, as well as the
' properties supplied by the supporting drivers such as Local Identifier, Connect
' Timeout and so on. The values for these properties can be set to connect to the
' current data source for the report or to change the data source for the report.
'
' MORE ALWAYS REQUIRED STEPS (contained in MoreRequiredSteps.asp)
' - retreive the records
' - create the page engine
'
' DISPLAY THE REPORT
' - display the report using a smart viewer
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%>
<%
%>
<%
' This line creates a string variable called reportname that we will use to pass
' the Crystal Report filename (.rpt file) to the OpenReport method contained in
' the AlwaysRequiredSteps.asp.
dim testasset
'testasset="MC0010:1101222 009"
'reportname = "Rtcer01.rpt?asset_ctag=" + testasset
reportname = "Rtcer01.rpt"
%>
<%
'========================= ========== ========== ========== ========== =
' ALWAYS REQUIRED STEPS
'
' Include the file AlwaysRequiredSteps.asp which contains the code
' for steps:
' - create the application object
' - create the report object
' - open the report
'========================= ========== ========== ========== ========== =
%>
<!-- #include file="AlwaysRequiredSteps. asp" -->
<%
'========================= ========== ========== ========== ========== =
'========================= ========== ========== ========== ========== =
' WORKING WITH SETLOGONINFO
'
' The datasource here is called "Pubs Sample Database". It is a System
' Datasource (DSN), and points to the "pubs" database, which is installed
' with SQL Server. You will also need to change your user id and
' password.
'Create a reference to the tables collection of the main report
Set mainReportTableCollection = Session("oRpt").Database.T ables
For Each mnTable in mainReportTableCollection
With mnTable.ConnectionProperti es
.Item("user ID") = "internet"
.Item("Password") = "iuser"
.Item("DSN") = "calibration data"
End With
Next
'session("oRpt").DiscardSa vedData
'========================= ========== ========== ========== ========== =
'========================= ========== ========== ========== ========== =
%>
<%
'========================= ========== ========== ========== ========== =
'
' MORE ALWAYS REQUIRED STEPS
'
' Include the file MoreRequiredSteps.asp which contains the code
' for the steps:
' - retreive the records
' - create the page engine
' - create the smart viewer and point it to rptserver.asp
'
'========================= ========== ========== ========== ========== =
%>
<!-- #include file="MoreRequiredSteps.as p" -->
<%
' INSTANTIATE THE REPORT VIEWER
'
'When using the Crystal Reports in an ASP environment, we use
'the same page-on-demand Report Viewers used with the Crystal Web Component Server.
'There are six Report Viewers:
'
'1. Report Viewer for ActiveX
'2. Report Viewer for Java using Browser JVM
'3. Report Viewer for Java Using Java Plugin
'
'The Report Viewer that you use will based on the browser's display capablities.
'For Example, you would not want to instantiate one of the Java viewers if the browser
'did not support Java applets. For purposes on this demo, we have chosen to
'define a viewer. You can through code determine the support capabilities of
'the requesting browser. However that functionality is inherent in the Crystal
'Reports RDC and is beyond the scope of this demonstration application.
'
'We have chosen to leverage the server side include functionality of ASP
'for simplicity sake. So you can use the SmartViewer*.asp files to instantiate
'the smart viewer that you wish to send to the browser. Simply replace the line
'below with the Smart Viewer asp file you wish to use.
'
'The choices are SmartViewerActiveX.asp, SmartViewerJava.asp and JavaPluginViewer.asp.
'Note that to use this include you must have the appropriate .asp file in the
'same virtual directory as the main ASP page.
'
'========================= ========== ========== ========== ========== ========== ==
' DISPLAY THE REPORT
' - display the report using a smart viewer
'
' Include one of the Smart Viewers.
' - Report Viewer for ActiveX = SmartViewerActiveX.asp
' - Report Viewer for Java Using Java Plugin = JavaPluginViewer.asp
'========================= ========== ========== ========== ========== ========== ==
%>
<%
'========================= ========== ========== ========== ========== =
' WORKING WITH DISCRETE PARAMETERS
' - Create a discrete parameter field value
' - Set parameter field value to the new parameter value
' - Get parameter in the report at the specified index
' - Copy properties of old parameter to new parameter
' - Add discrete value to this new parameter field
' - Modify parameter through the DataDefControler and the ParameterFieldController
'========================= ========== ========== ========== ========== =
Public Sub PassParameter(param_index, param_value)
Dim paramValue ' discrete parameter value
Dim param_old ' parameter field in the report
Dim param_new 'parameter field that will replace old parameter
' Create a discrete parameter field value
Set paramValue = objFactory.CreateObject("C rystalRepo rts.Parame terFieldDi screteValu e")
' Set parameter field value to the new parameter value
paramValue.Value = param_value
' Get parameter in the report at the position param_index
Set param_old = clientDoc.DataDefinition.P arameterFi elds.Item( param_inde x)
' Create a new parameter field object
Set param_new = objFactory.CreateObject("C rystalRepo rts.Parame terField")
' Copy properties of old parameter to new parameter
param_old.CopyTo param_new
' Add discrete value to this new parameter field
param_new.CurrentValues.Ad d paramValue
' Modify parameter through the DataDefControler and the ParameterFieldController
clientDoc.DataDefControlle r.Paramete rFieldCont roller.Mod ify param_old, param_new
' Clean up
Set paramValue = Nothing
Set param_new = Nothing
End Sub
' Pass the parameter values to the index postions
PassParameter 0, "MC0010:1101222009"
%>
<!-- #include file="SmartViewerActiveX.a sp" -->
========================== ========== ========== ========== ========== ========== ========== ========
Please don't paste a reference for me to look up more samples . I've already tried too manysamples doing just that.
Thanks Pete
I'm using Crystal 10 advanced .
What is happening is that the page opens but is missing the dynamic data . But all the static field labels are there.
I'm wondering if its not due to the colon in the data I'm passing . The parameter in the report is asset_ctag .
There are 2 ways to pass parameters , 1 is by indexed parameters and the other is by named parameters .
I haven't seen ant reference to the named process. There is only 1 parameter in my report.
If I run the discrete parameter asp sample it works ok.
==========================
<%@ LANGUAGE="VBSCRIPT" %>
<%
'=========================
' WORKING WITH THE REPORT DESIGNER COMPONENT AND ASP TO LOG IN TO A MAIN REPORT
'=========================
'
' CONCEPT
'
' ALWAYS REQUIRED STEPS (contained in AlwaysRequiredSteps.asp)
' - create the application object
' - create the report object
' - open the report
'
' WORKING WITH ConnectionProperty Object
' The ConnectionProperty Object is a property bag that stores connection
' information for the report. Information is dependent on the Crystal Decisions
' database DLL used by the report and the database drivers that support the DLL.
' The collection of ConnectionProperty objects can hold common properties defined
' in our database DLLs, connection properties from the supporting drivers, or
' both. For example a report based off an OLEDB (ADO) connection to Microsoft SQL
' Server will contain properties supplied by the database DLL (crdb_ado.dll) such
' as Provider, Data Source, Initial Catalog, User ID, and Password, as well as the
' properties supplied by the supporting drivers such as Local Identifier, Connect
' Timeout and so on. The values for these properties can be set to connect to the
' current data source for the report or to change the data source for the report.
'
' MORE ALWAYS REQUIRED STEPS (contained in MoreRequiredSteps.asp)
' - retreive the records
' - create the page engine
'
' DISPLAY THE REPORT
' - display the report using a smart viewer
' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
%>
<%
%>
<%
' This line creates a string variable called reportname that we will use to pass
' the Crystal Report filename (.rpt file) to the OpenReport method contained in
' the AlwaysRequiredSteps.asp.
dim testasset
'testasset="MC0010:1101222
'reportname = "Rtcer01.rpt?asset_ctag=" + testasset
reportname = "Rtcer01.rpt"
%>
<%
'=========================
' ALWAYS REQUIRED STEPS
'
' Include the file AlwaysRequiredSteps.asp which contains the code
' for steps:
' - create the application object
' - create the report object
' - open the report
'=========================
%>
<!-- #include file="AlwaysRequiredSteps.
<%
'=========================
'=========================
' WORKING WITH SETLOGONINFO
'
' The datasource here is called "Pubs Sample Database". It is a System
' Datasource (DSN), and points to the "pubs" database, which is installed
' with SQL Server. You will also need to change your user id and
' password.
'Create a reference to the tables collection of the main report
Set mainReportTableCollection = Session("oRpt").Database.T
For Each mnTable in mainReportTableCollection
With mnTable.ConnectionProperti
.Item("user ID") = "internet"
.Item("Password") = "iuser"
.Item("DSN") = "calibration data"
End With
Next
'session("oRpt").DiscardSa
'=========================
'=========================
%>
<%
'=========================
'
' MORE ALWAYS REQUIRED STEPS
'
' Include the file MoreRequiredSteps.asp which contains the code
' for the steps:
' - retreive the records
' - create the page engine
' - create the smart viewer and point it to rptserver.asp
'
'=========================
%>
<!-- #include file="MoreRequiredSteps.as
<%
' INSTANTIATE THE REPORT VIEWER
'
'When using the Crystal Reports in an ASP environment, we use
'the same page-on-demand Report Viewers used with the Crystal Web Component Server.
'There are six Report Viewers:
'
'1. Report Viewer for ActiveX
'2. Report Viewer for Java using Browser JVM
'3. Report Viewer for Java Using Java Plugin
'
'The Report Viewer that you use will based on the browser's display capablities.
'For Example, you would not want to instantiate one of the Java viewers if the browser
'did not support Java applets. For purposes on this demo, we have chosen to
'define a viewer. You can through code determine the support capabilities of
'the requesting browser. However that functionality is inherent in the Crystal
'Reports RDC and is beyond the scope of this demonstration application.
'
'We have chosen to leverage the server side include functionality of ASP
'for simplicity sake. So you can use the SmartViewer*.asp files to instantiate
'the smart viewer that you wish to send to the browser. Simply replace the line
'below with the Smart Viewer asp file you wish to use.
'
'The choices are SmartViewerActiveX.asp, SmartViewerJava.asp and JavaPluginViewer.asp.
'Note that to use this include you must have the appropriate .asp file in the
'same virtual directory as the main ASP page.
'
'=========================
' DISPLAY THE REPORT
' - display the report using a smart viewer
'
' Include one of the Smart Viewers.
' - Report Viewer for ActiveX = SmartViewerActiveX.asp
' - Report Viewer for Java Using Java Plugin = JavaPluginViewer.asp
'=========================
%>
<%
'=========================
' WORKING WITH DISCRETE PARAMETERS
' - Create a discrete parameter field value
' - Set parameter field value to the new parameter value
' - Get parameter in the report at the specified index
' - Copy properties of old parameter to new parameter
' - Add discrete value to this new parameter field
' - Modify parameter through the DataDefControler and the ParameterFieldController
'=========================
Public Sub PassParameter(param_index,
Dim paramValue ' discrete parameter value
Dim param_old ' parameter field in the report
Dim param_new 'parameter field that will replace old parameter
' Create a discrete parameter field value
Set paramValue = objFactory.CreateObject("C
' Set parameter field value to the new parameter value
paramValue.Value = param_value
' Get parameter in the report at the position param_index
Set param_old = clientDoc.DataDefinition.P
' Create a new parameter field object
Set param_new = objFactory.CreateObject("C
' Copy properties of old parameter to new parameter
param_old.CopyTo param_new
' Add discrete value to this new parameter field
param_new.CurrentValues.Ad
' Modify parameter through the DataDefControler and the ParameterFieldController
clientDoc.DataDefControlle
' Clean up
Set paramValue = Nothing
Set param_new = Nothing
End Sub
' Pass the parameter values to the index postions
PassParameter 0, "MC0010:1101222009"
%>
<!-- #include file="SmartViewerActiveX.a
==========================
Please don't paste a reference for me to look up more samples . I've already tried too manysamples doing just that.
Thanks Pete
ASKER
Hi Gary ,
I tried your code ,but it gives me an error at line 124 of the first page .
Microsoft VBscript compilation error 800a03fc
"Expected ' next' " when viewed with netscape 4.7 and 7.02 .IE6 just says there
is an error .
I changed the name of the Estimate Breakdown.rpt to SimpleDiscreteParameters.r pt .
I also changed the line ParamValue1 = Request("P1") to ParamValue1 ="this is a test"
Do you know of a good reference book for web based Crystal ?
Pete
I tried your code ,but it gives me an error at line 124 of the first page .
Microsoft VBscript compilation error 800a03fc
"Expected ' next' " when viewed with netscape 4.7 and 7.02 .IE6 just says there
is an error .
I changed the name of the Estimate Breakdown.rpt to SimpleDiscreteParameters.r
I also changed the line ParamValue1 = Request("P1") to ParamValue1 ="this is a test"
Do you know of a good reference book for web based Crystal ?
Pete
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the line ParamValue1 = Request("P1") is where I pass the paramater entered from a previous HTML page
you will need to edit the file as necessary
Estimate Breakdown.asp
==========================
<%@ Language=VBScript %>
<%
'This page was created by Gary Parker 10/03/2004
basePath = Request.ServerVariables("P
While (Right(basePath, 1) <> "\" And Len(basePath) <> 0)
iLen = Len(basePath) - 1
basePath = Left(basePath, iLen)
Wend
baseVirtualPath = Request.ServerVariables("P
While (Right(baseVirtualPath, 1) <> "/" And Len(baseVirtualPath) <> 0)
iLen = Len(baseVirtualPath) - 1
baseVirtualPath = Left(baseVirtualPath, iLen)
Wend
If Not IsObject(session("oApp")) Then
Set session("oApp") = Server.CreateObject("Cryst
If Not IsObject(session("oApp")) Then
response.write "Error: Could not instantiate the Crystal Reports automation server. Please check to see that Crystal Reports has been properly installed on the web server PC"
response.end
End If
End If
If IsObject(session("oRpt")) then
set session("oRpt") = nothing
End If
If autofilespec <> "" Then
reportFileName = autofilespec
Else
reportFileName = "Estimate Breakdown.rpt"
End If
Set session("oRpt") = session("oApp").OpenReport
If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description
Set Session("oRpt") = Nothing
Set Session("oApp") = Nothing
Session.Abandon
Response.End
End If
session("oRpt").MorePrintE
session("oRpt").EnablePara
'Create a reference to the tables collection of the main report
'Set mainReportTableCollection = Session("oRpt").Database.T
For Each mnTable in mainReportTableCollection
With mnTable.ConnectionProperti
.Item("DSN") = ""
.Item("Database") =""
.Item("user ID") = ""
.Item("Password") = ""
End With
'Next
set session("ParamCollection")
set Param1 = session("ParamCollection")
ParamValue1 = Request("P1")
Call Param1.SetCurrentValue (CDbl(ParamValue1))
If IsObject (session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
%>
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize" ONUNLOAD="CallDestroy()" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
CLASSID="CLSID:A1B8A30B-8A
WIDTH=100% HEIGHT=99%
CODEBASE="/crystalreportvi
<PARAM NAME="EnableRefreshButton"
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl"
<PARAM NAME="EnableAnimationContr
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="DisplayToolbar" VALUE=1>
<PARAM NAME="EnableProgressContro
<PARAM NAME="EnableStopButton" VALUE=1>
<PARAM NAME="EnableCloseButton" VALUE=1>
<PARAM NAME="EnableNavigationCont
<PARAM NAME="PromptOnRefresh" VALUE=0>
<PARAM NAME="EnablePopupMenu" VALUE=1>
<PARAM NAME="DisplayBackgroundEdg
<PARAM NAME="DisplayBorder" VALUE=1>
<PARAM NAME="DisplayTabs" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
zoomTimer = window.setInterval("setZoo
Sub setZoom()
if not CRViewer.IsBusy then
window.clearInterval(zoomT
CRViewer.Zoom(100)
end if
End Sub
Sub Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("CrystalRepor
if ScriptEngineMajorVersion < 2 then
window.alert "Internet Explorer 3.02 users running Windows NT 4 should get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users running Windows 95 need DCOM95 and the latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
CRViewer.ReportName = Location.Protocol + "//" + Location.Host + <% response.write( chr(34) & baseVirtualPath & chr(34)) %> + "rptserver.asp"
else
Dim webSource
Set webSource = CreateObject("CrystalRepor
webSource.ReportSource = webBroker
webSource.URL = Location.Protocol + "//" + Location.Host + <% response.write( chr(34) & baseVirtualPath & chr(34)) %> + "RDCrptserver10.asp"
webSource.PromptOnRefresh = False
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
<script language="javascript">
function CallDestroy()
{
window.open("Cleanup.asp",
}
</script>
</BODY>
</HTML>
==========================
The other ASP Files used are
RDCrptserver10.asp
==========================
<%
' This script assumes that the Session contains the following Crystal Report Engine
' Objects:
'
' "oApp" - Crystal Report Engine Application Object
' "oRpt" - Crystal Report Engine Report Object
' "oPageEngine - Crystal Report Engine Page Engine Object
On Error Resume Next
' The oEMF object is a helper object to create EMFs (Ecapsulated Messages) for the viewers.
' The viewers use EMFs to display errors and navigate to specific pages of the report.
If Not IsObject(session("oEMF")) then
Set session("oEMF") = Server.CreateObject("Cryst
Call CheckForError
End if
' Initialize all Global variables
' These will contain the page generator and page collection
Dim goPageGenerator ' page generator object
Dim goPageCollection ' page collection object
Dim goPageGeneratorDrill' page generator object in Drill Down Context
Dim goPage ' the page object
Dim gvGroupPathDD ' drill down group path, this is an array.
Dim gvGroupPath ' this is branch, aka Group Path converted from string passed on the QS, it is an Array
Dim gvGroupLevel ' this is the Group level, converted from the string passed on the QS, it is an Array
Dim gvMaxNode ' this represents the number of nodes to retrieve for the totaller, it is set to an empty array
Dim gvTotallerInfo ' this represents the group path of the requested totaller.
Dim glX ' this is the X Coordinate for a drill down on a graph or Map
Dim glY ' this is the Y Coordinate for a drill down on a graph or Map
Dim gvPageNumber ' holds the requested page number
Dim gvURL ' URL to redirect to
Dim gsErrorText ' holds the error text to be sent to the viewer.
Dim ExportOptions ' Export Options Object
Dim slX ' this is the X Coordinate for a selection of Out of Place subreport
Dim slY ' this is the Y Coordinate for a selection of Out of Place subreport
Dim sessionError ' this is the variable that will contain the error text sent to the viewer when the session has expired.
' Vaiables that represent what was passed on the Query String
Dim CMD ' This determines the main function to perform
Dim PAGE ' the page to return
Dim BRCH ' the branch is a mechanism to determine the drill down level.
' A drill down level is like a view of the report, a new tab
' is created to indicate that it is a new view
Dim VIEWER ' This is the viewer that is calling the server
Dim VFMT ' the format that the viewer understands
Dim NODE ' Currently not used??
Dim GRP ' this is a way of specifing the actual group
Dim COORD ' these are the coordinates on the graph to process
Dim DIR ' this is the search direction
Dim CSE ' indicates if the search is case sensitive
Dim TEXT ' this is the text to search for.
Dim INIT ' used to build the frames for the html viewer
Dim NEWBRCH ' used to keep track of when a new branch is to be viewed.
Dim EXPORT_FMT ' used to hold the export format and type
Dim SUBRPT ' used to hold the Out Of Place Subreport page, number,
' and coordinates on the main report.
Dim INCOMPLETE_PAGE ' used to indicate whether the page generated should contain placeholders.
Dim INCOMPLETE_PAGE_COUNT ' used to indicate whether the page should contain the total page count if not yet generated.
Dim PVERSION ' used to indicate the protocol version of the viewer.
Dim TTL_INFO ' used to indicate the group path of the totaller request.
Dim IMAGE ' used to specify the name of the image file for html viewers.
Dim DEL ' used to specify whether to delete image file after it has been sent to client.
' Constant Values
Dim CREFTWORDFORWINDOWS
Dim CREFTRICHTEXT
Dim CREFTEXCEL21
Dim CREFTEXCEL70
Dim CREFTCRYSTALREPORT
Dim CREFTPORTABLEDOCFORMAT
Dim CREDTDISKFILE
Dim EMFMIMETYPE
CREFTWORDFORWINDOWS = 14
CREFTRICHTEXT = 35
CREFTEXCELDATAONLY = 38
CREFTEXCEL = 36
CREFTCRYSTALREPORT = 1
CREFTPORTABLEDOCFORMAT = 31
CREDTDISKFILE = 1
crAllowPlaceHolders = 2
crDelayTotalPageCountCalc = 1
EMFMIMETYPe = "application/x-emf"
EPFMIMETYPE = "application/x-epf"
ETFMIMETYPE = "application/x-etf"
' Initialize Arrays
gvGroupPath = Array()
gvGroupLevel = Array()
gvMaxNode = Array() ' reteive all nodes
gvTotallerInfo = Array()
NEWBRCH = "0"
sessionError = "An error has occurred."
' To ensure that the browser does not cache the html pages for the group trees.
Response.Expires = 0
' Parse Query String for paramaters
Call ParseQS()
' If the request is for a image, we do not process the remainder of the page. Rather, we simply return
' the image file.
if IMAGE <> "" then
Call session("oEMF").StreamImag
Response.End
end if
' INIT is a special QS case, we only care about HTML viewer, if it is then save send page and branch info
' to the frame page
if INIT = "HTML_FRAME" then
' build URL and send the QS
if BRCH <> "" and NEWBRCH = "1" then
' htmstart is the base page that creates the frames for the HTML viewer
' if there is branch information it needs to be passed along.
tmpArray = session("tabArray")
if tmpArray(0) <> "EMPTY" then
val = UBound(tmpArray, 1) + 1
redim preserve tmpArray(val + 4)
else
val = 0
end if
tmpArray(val) = CStr(val)
tmpArray(val + 1) = session("lastBrch")
session("lastBrch") = BRCH
tmpArray(val + 2) = session("CurrentPageNumber
tmpArray(val + 3) = session("lastknownpage")
tmpArray(val + 4) = session("LastPageNumber")
session("tabArray") = tmpArray
gvURL = "htmstart.asp?brch=" & BRCH & "&"
else
if BRCH <> "" then
gvURL = "htmstart.asp?brch=" & BRCH
else
gvURL = "htmstart.asp"
end if
end if
response.redirect gvURL
end if
' If there is a BRCH then create the gvGroupPath array that represents it.
if BRCH <> "" then
gvGroupPath = CreateArray(BRCH)
end if
' If there is a GRP then create the gvGroupLevel array that represents it.
if GRP <> "" then
gvGroupLevel = CreateArray(GRP)
end if
' If there is a TTL_INFO then create the gvTotallerInfo array that represents it.
if TTL_INFO <> "" then
gvTotallerInfo = CreateArray(TTL_INFO)
end if
' If there are COORDs, then get them
if COORD <> "" then
Call GetDrillDownCoordinates(CO
end if
' This case statement determines what action to perform based on CMD
' there are sub cases for each viewer type
Select Case CMD
Case "GET_PG"
Call RetrieveObjects
' create the actual page
Set goPage = goPageCollection(PAGE)
' check for an exception on the page number
Call ValidatePageNumber
' 0 is for epf, 8209 is a SafeArray
Select Case VFMT
Case "ENCP"
session("oPageEngine").Pla
if(PVERSION > 2)then
if INCOMPLETE_PAGE > 0 then
session("oPageEngine").Pla
end if
if INCOMPLETE_PAGE_COUNT > 0 then
session("oPageEngine").Pla
end if
end if
session("oPageEngine").Ima
temp = goPage.Renderepf(8209)
Response.AddHeader "CONTENT-LENGTH", lenb(temp)
Response.ContentType = EPFMIMETYPE
response.binarywrite temp
Case "HTML_FRAME"
session("oPageEngine").Ima
response.binarywrite goPage.Renderhtml(1,2,1,re
' Need to know if it is the last page to construct the toolbar correctly
if goPage.IsLastPage then
session("LastPageNumber") = goPage.pagenumber
session("CurrentPageNumber
end if
Case "HTML_PAGE"
session("oPageEngine").Ima
response.binarywrite goPage.Renderhtml(1,3,3,re
end select
Case "GET_TTL"
Call RetrieveObjects
Select Case VFMT
Case "ENCP"
Response.ContentType = ETFMIMETYPE
if(PVERSION > 2)then
temp = goPageGenerator.RenderTota
else
temp = goPageGenerator.RenderTota
end if
Response.AddHeader "CONTENT-LENGTH", lenb(temp)
response.binarywrite temp
Case "HTML_FRAME"
response.binarywrite goPageGenerator.RenderTota
end select
Case "RFSH"
' This command forces the database to be read again.
session("oRpt").DiscardSav
If Err.Number <> 0 Then
Call CheckForError
Else
session("oRpt").EnablePara
session("oRpt").ReadRecord
Set session("oPageEngine") = session("oRpt").PageEngine
End If
Call RetrieveObjects
Set goPage = goPageCollection(PAGE)
Call ValidatePageNumber
session("oPageEngine").Ima
Select Case VFMT
Case "ENCP"
' Java and Active X Viewers will make a get page command when receiving 0 error msg value
if VIEWER = "JAVA" then
session("oPageEngine").Pla
if(PVERSION > 2)then
if INCOMPLETE_PAGE > 0 then
session("oPageEngine").Pla
end if
if INCOMPLETE_PAGE_COUNT > 0 then
session("oPageEngine").Pla
end if
end if
temp = goPage.Renderepf(8209)
Response.AddHeader "CONTENT-LENGTH", lenb(temp)
Response.ContentType = EPFMIMETYPE
response.binarywrite temp
else
Response.ContentType = EMFMIMETYPE
session("oEMF").SendErrorM
end if
Case "HTML_FRAME"
InitializeFrameArray()
gvURL = "htmstart.asp"
response.redirect gvURL
Case "HTML_PAGE"
session("oPageEngine").Ima
response.binarywrite goPage.Renderhtml(1,3,1,re
end select
Case "NAV"
Call RetrieveObjects
Call CheckForError
' Get the page number that the group in on, for this particular branch
gvPageNumber = goPageGenerator.GetPageNum
Select Case VFMT
' 0 is for epf, 8209 is a SafeArray, 8 is a BSTR
Case "ENCP"
' Create a byte array for the EMF, which will contain the page number
Response.ContentType = EMFMIMETYPE
session("oEMF").sendpagenu
Case "HTML_FRAME"
' for html browser send back the page
dim appendQuery
appendQuery = "?"
session("CurrentPageNumber
if BRCH <> "" then
appendQuery = appendQuery & "BRCH=" & BRCH & "&"
end if
if GRP <> "" then
appendQuery = appendQuery & "GRP=" & GRP
end if
response.redirect "framepage.asp" & appendQuery
end select
Case "CHRT_DD"
' only supported in java and active X smart viewers
Select Case VFMT
Case "ENCP"
' Get page collection
Call RetrieveObjects
Call CheckForError
' Pass the coordinates to the report engine to determine what
' branch the drill down goes to.
Set goPageGeneratorDrill = goPageGenerator.DrillOnGra
' Check for an exception because of coordinates
if err.number <> 0 then
gsErrorText = "Not part of the Graph "
Response.ContentType = EMFMIMETYPE
session("oEMF").SendErrorM
err.clear
response.end
end if
' pass the group level and group path to helper function to create
' the EMF message, this tells the viewer where to get the page.
gvGroupPathDD = goPageGeneratorDrill.group
gvGroupNameDD = goPageGeneratorDrill.group
Response.ContentType = EMFMIMETYPE
session("oEMF").GroupName = gvGroupNameDD
session("oEMF").sendbranch
end select
Case "GET_LPG"
' only support in smart viewers
Select Case VFMT
Case "ENCP"
' this command returns the page number of the last page
' Get page collection
Call RetrieveObjects
Call CheckForError
' Get the count from the Pages collection
gvPageNumber = goPageCollection.Count
' Send the EMF representing the page number
Response.ContentType = EMFMIMETYPE
session("oEMF").sendpagenu
end select
Case "SRCH"
Call RetrieveObjects
Call CheckForError
' create page variable
gvPageNumber = CInt(PAGE)
Select Case VFMT
Case "ENCP"
if goPageGenerator.FindText(T
Response.ContentType = EMFMIMETYPE
session("oEMF").sendpagenu
else
gsErrorText = "The specified text, '" & TEXT & "' was not found in the report"
Response.ContentType = EMFMIMETYPE
session("oEMF").SendErrorM
end if
Case "HTML_FRAME"
' We are being called by HTML viewer
' need to get the text from the form post
dim searchFound
TEXT = request.form("text")
' Now find out what page the text is on
tempNumber = gvPageNumber + 1
If(CBool(goPageGenerator.F
session("CurrentPageNumber
searchFound = 1
else
session("CurrentPageNumber
searchFound = 0
End If
if BRCH <> "" then
gvURL = "framepage.asp?brch=" & BRCH & "&SEARCHFOUND=" & searchFound
else
gvURL = "framepage.asp?SEARCHFOUND
end if
response.redirect gvURL
Case "HTML_PAGE"
' We are being called by HTML viewer
' need to get the text from the form post
TEXT = request.form("text")
' Now find out what page the text is on
tempNumber = gvPageNumber
If(CBool(goPageGenerator.F
gvPageNumber = tempNumber
Set goPage = goPageCollection(gvPageNum
session("oPageEngine").Ima
response.binarywrite goPage.Renderhtml(1,3,3,re
else
' Send back an html page indicating the text was not found.
Response.Write "<html><title>Seagate ASP Reports Server</title><body bgcolor='white'><center><h
End If
end select
Case "TOOLBAR_PAGE"
' Redirect to the framepage, need to know if we are
' on the last page.
if session("LastPageNumber") <> "" then
if CInt(PAGE) > CInt(session("LastPageNumb
session("CurrentPageNumber
else
session("CurrentPageNumber
end if
else
Call RetrieveObjects
Call CheckForError
' create the actual page
Set goPage = goPageCollection(PAGE)
' check for an exception on the page number
Call ValidatePageNumber
if goPage.IsLastPage then
session("LastPageNumber") = goPage.pagenumber
session("CurrentPageNumber
else
session("CurrentPageNumber
end if
end if
if BRCH <> "" then
gvURL = "framepage.asp?brch=" & BRCH
else
gvURL = "framepage.asp"
end if
response.redirect gvURL
Case "EXPORT"
Set ExportOptions = Session("oRpt").ExportOpti
Session("oRpt").DisplayPro
if(FillExportOptionsObject
Call RetrieveObjects
response.binarywrite goPageGenerator.Export(820
Call CheckForError
else
Response.ContentType = EMFMIMETYPE
session("oEMF").SendErrorM
end if
Case "MAP_DD"
' only supported in java and active X smart viewers
Select Case VFMT
Case "ENCP"
' Get page collection
Call RetrieveObjects
Call CheckForError
' Pass the coordinates to the report engine to determine what
' branch the drill down goes to.
Set goPageGeneratorDrillonMap = goPageGenerator.DrillOnMap
' Check for an exception because of coordinates
if err.number <> 0 then
gsErrorText = "No Values Exist for Selected Region of Map"
Response.ContentType = EMFMIMETYPE
session("oEMF").SendErrorM
err.clear
response.end
end if
' pass the group level and group path to helper function to create
' the EMF message, this tells the viewer where to get the page.
gvGroupPathDD = goPageGeneratorDrillonMap.
gvGroupNameDD = goPageGeneratorDrillonMap.
session("oEMF").GroupName = gvGroupNameDD
Response.ContentType = EMFMIMETYPE
session("oEMF").sendbranch
end select
end select
SUB RetrieveObjects()
' This procedure simply retrieves the session objects into global variables.
' In the case of Out of Place Subreports, the SUBRPT parameter must be parsed and the
' Subreport page generator object must be created.
Dim oRptOptions 'Report Options
Dim charIndexVal,tmpCharIndexV
Dim tmpStr
Dim tmpPageGenerator
Dim subPageGenerator
Dim OOPSSeqNo 'holds the page's OOPS sequence number
Dim OOPSSubName 'holds the OOPS's name
Dim subCoords 'holds the coordinates of the OOPS in the main report
Dim subgvGroupPath 'holds the group path for the main report in subrpt parameter
Dim mainRptPageNumber 'holds the page number for the main report in the subrpt parameter
subgvGroupPath = Array()
if IsObject(session("oPageEng
' make sure dialogs have been disabled
if SUBRPT <> "" Then
' Obtain the subreport sequence number
charIndexVal = findChar(SUBRPT, ":")
if charIndexVal > 1 then
OOPSSeqNo = Mid(SUBRPT,1,charIndexVal - 1)
end if
' Obtain the subreport's name
tmpStr = Mid(SUBRPT,charIndexVal + 1)
charIndexVal = findChar(tmpStr, ":")
if charIndexVal > 1 then
OOPSSubName = Mid(tmpStr,1,charIndexVal - 1)
end if
tmpStr = Mid(tmpStr,charIndexVal + 1)
charIndexVal = findChar(tmpStr, ":")
' Obtain the group path for the Out of Place Subreport
if charIndexVal > 1 then
subgvGroupPath = CreateArray(Mid(tmpStr, 1, charIndexVal - 1))
end if
'Obtain the main report page number after the fourth : character
tmpStr = Mid(tmpStr,charIndexVal + 1)
'Get the location of the fourth : seperator
charIndexVal = findChar(tmpStr, ":")
mainRptPageNumber = Mid(tmpStr, 1, charIndexVal - 1)
'Get the coordinates portion of the SUBRPT parameter
subCoords = Mid(tmpStr, charIndexVal + 1)
Call GetDrillDownCoordinates(su
' Get the main reports page generator for the view
Set tmpPageGenerator = session("oPageEngine").Cre
Set subPageGenerator = tmpPageGenerator.DrillOnSu
Set goPageGenerator = subPageGenerator.CreateSub
else
Set goPageGenerator = session("oPageEngine").Cre
end if
Set goPageCollection = goPageGenerator.Pages
else
' must have timed out return an error, you may wan to Append to the
' IIS log here.
if VFMT = "ENCP" then
Response.ContentType = EMFMIMETYPE
session("oEMF").SendErrorM
else
response.write sessionError
end if
response.end
end if
END SUB
SUB ParseQS()
DIM UTF8STR ' this is the string in UTF-8 format returned from the viewer
' Parse the Query String
CMD = UCase(request.querystring(
PAGE = UCase(request.querystring(
BRCH = UCase(request.querystring(
' A drill down level is like a view of the report, a new tab
' is created to indicate that it is a new view
VIEWER = UCase(request.querystring(
VFMT = UCase(request.querystring(
NODE = UCase(request.querystring(
GRP = UCase(request.querystring(
COORD = UCase(request.querystring(
DIR = UCase(request.querystring(
CSE = UCase(request.querystring(
UTF8STR = request.querystring("TEXT"
TEXT = session("oEMF").DecodeUTF8
INIT = UCase(request.querystring(
TAB = UCase(request.querystring(
EXPORT_FMT = UCase(request.querystring(
UTF8STR = request.querystring("SUBRP
SUBRPT = UCase(session("oEMF").Deco
INCOMPLETE_PAGE = CInt(request.querystring("
INCOMPLETE_PAGE_COUNT = CInt(request.querystring("
PVERSION = CInt(request.querystring("
TTL_INFO = UCase(request.querystring(
IMAGE = UCase(request.querystring(
DEL = Cint(request.querystring("
' Initialize variables to a default if they are not provided on the query string.
' Check for Parameter Values that are passed by the HTTP Post Command.
if CMD = "" then
CMD = UCase(request.form("cmd"))
if CMD = "" then
CMD = "GET_PG"
end if
end if
if INIT = "" then
INIT = UCase(request.form("INIT")
end if
if BRCH = "" then
BRCH = UCase(request.form("BRCH")
end if
if BRCH = "" and INIT = "HTML_FRAME" then
Call InitializeFrameArray
end if
if BRCH <> "" and INIT = "HTML_FRAME" then
if session("lastBrch") <> BRCH then
NEWBRCH = "1"
end if
end if
if VIEWER = "" then
VIEWER = UCase(request.form("VIEWER
if VIEWER = "" then
VIEWER = "HTML"
end if
end if
if VFMT = "" then
VFMT = UCase(request.form("VFMT")
if VFMT = "" then
VFMT = "HTML_PAGE"
end if
end if
if GRP = "" then
GRP = UCase(request.form("GRP"))
end if
if TTL_INFO = "" then
TTL_INFO = UCase(request.form("TTL_IN
end if
if COORD = "" then
COORD = UCase(request.form("COORD"
end if
if NODE = "" then
NODE = UCase(request.form("NODE")
end if
if DIR = "" then
DIR = UCase(request.form("DIR"))
if DIR = "" then
DIR = "FOR" ' forward
end if
End if
if CSE = "" then
CSE = UCase(request.form("CASE")
if CSE = "" then
CSE = "0" ' case insensitive
end if
end if
if TEXT = "" then
UTF8STR = request.form("TEXT")
TEXT = session("oEMF").DecodeUTF8
end if
if EXPORT_FMT = "" then
EXPORT_FMT = UCase(request.form("EXPORT
end if
if SUBRPT = "" then
UTF8STR = request.form("SUBRPT")
SUBRPT = UCase(session("oEMF").Deco
end if
if request.form("INCOMPLETE_P
INCOMPLETE_PAGE = CInt(request.form("INCOMPL
end if
if request.form("INCOMPLETE_P
INCOMPLETE_PAGE_COUNT = CInt(request.form("INCOMPL
end if
if PVERSION = 0 then
PVERSION = CInt(request.form("PVERSIO
end if
if IMAGE = "" then
IMAGE = request.form("IMAGE")
end if
if DEL = 0 then
DEL = Cint(request.form("DEL"))
end if
' Check to make sure there is a page requested, if not use 1 as a default
if PAGE = "" then
PAGE = UCase(request.form("page")
if PAGE = "" then
PAGE = "1"
end if
end if
if PAGE <> "" and NOT IsNumeric(PAGE) then
PAGE = "1"
end if
END SUB
Function CreateArray(ByVal vsStringArray)
' this function takes an string like 0-1-1-0 and converts
' it into an array of integers
Dim lvArray
Dim lvNewArray
Dim liCount
Dim liCurrentPos
Dim lsBuf
lvArray = Array()
lvNewArray = Array()
ReDim lvArray(256)
liStringLength = Len(vsStringArray)
liCount = 0
liCurrentPos = 1
lsBuf = ""
While liCurrentPos <= liStringLength
'ignore this character
If Mid(vsStringArray, liCurrentPos, 1) <> "-" Then
lsBuf = lsBuf & Mid(vsStringArray, liCurrentPos, 1)
If liCurrentPos = liStringLength Then
lvArray(liCount) = CInt(lsBuf)
lsBuf = ""
liCount = liCount + 1
End If
Else
lvArray(liCount) = CInt(lsBuf)
lsBuf = ""
liCount = liCount + 1
End If
liCurrentPos = liCurrentPos + 1
Wend
ReDim lvNewArray(liCount - 1)
For x = 0 To (liCount - 1)
lvNewArray(x) = lvArray(x)
Next
CreateArray = lvNewArray
End Function
' Helper function to parse coordinates passed by viewers and place into independent variables.
SUB GetDrillDownCoordinates(By
Dim liStringLength
Dim lbDone
Dim lsBuf
liStringLength = Len(strParam)
lbDone = FALSE
lsBuf = ""
xCoord = ""
yCoord = ""
For x = 1 To liStringLength
lsBuf = Mid(strParam, x, 1)
'ignore this character
If lsBuf = "-" Then
lsBuf = ""
lbDone = TRUE
End if
if lbDone then
yCoord = yCoord + lsBuf
else
xCoord = xCoord + lsBuf
end if
Next
END SUB
' This helper procedure will check if the requested page number exists.
' If it does not, it will set it to the last available page.
SUB ValidatePageNumber()
if err.number <> 0 then
if err.number = 9 then
' just return the last page
PAGE = goPageCollection.count
Set goPage = goPageCollection(PAGE)
' these session variables are used for the HTML Frame viewer
session("LastPageNumber") = PAGE
session("CurrentPageNumber
err.clear
else
' A more serious error has occurred. Error message sent to browser.
Call CheckForError
end if
end if
END SUB
' This helper procedure will send an error msg to the browser based on what viewer is being used.
SUB CheckForError()
If Err.Number <> 0 Then
if VFMT = "ENCP" then
Response.ContentType = EMFMIMETYPE
session("oEMF").SendErrorM
else
Response.Write "CRAXDRT Error Occured on Server. Error Number: " & Err.Number & " Error Description: " & Err.Description
end if
Response.end
End if
END SUB
SUB InitializeFrameArray()
'initialize the html_frame array
set session("tabArray") = Nothing
session("lastBrch") = ""
dim tmpArray
tmpArray = Array(4)
redim tmpArray(4)
'Initialize the sequence number
tmpArray(0) = "EMPTY"
session("tabArray") = tmpArray
END SUB
' Helper function to parse the EXPORT_FMT parameter and fill in the properties of the
' Export object.
FUNCTION FillExportOptionsObject(ex
dim charIndex
dim exportType
dim exportDLLName
charIndex = findChar(export_fmt_option
'Set session("ExportOptions") = Session("oRpt").ExportOpti
if(charIndex > 0) Then
'Get the export format type value
exportType = Mid(export_fmt_options, charIndex + 1)
exportDLLName = UCase(Mid(export_fmt_optio
Select Case exportDLLName
Case "CRXF_WORDW"
ExportOptions.FormatType = CREFTWORDFORWINDOWS
GetExportPageRange startPage, endPage
If startPage > 0 Then
ExportOptions.WordWExportA
ExportOptions.WordWFirstPa
ExportOptions.WordWLastPag
Else
ExportOptions.WordWExportA
End If
Response.ContentType = "application/msword"
Case "U2FWORDW"
ExportOptions.FormatType = CREFTWORDFORWINDOWS
GetExportPageRange startPage, endPage
If startPage > 0 Then
ExportOptions.WordWExportA
ExportOptions.WordWFirstPa
ExportOptions.WordWLastPag
Else
ExportOptions.RTFExportAll
End If
Response.ContentType = "application/msword"
Case "CRXF_RTF"
ExportOptions.FormatType = CREFTRICHTEXT
GetExportPageRange startPage, endPage
If startPage > 0 Then
ExportOptions.RTFExportAll
ExportOptions.RTFFirstPage
ExportOptions.RTFLastPageN
Else
ExportOptions.RTFExportAll
End If
Response.ContentType = "application/rtf"
Case "U2FRTF"
ExportOptions.FormatType = CREFTRICHTEXT
GetExportPageRange startPage, endPage
If startPage > 0 Then
ExportOptions.RTFExportAll
ExportOptions.RTFFirstPage
ExportOptions.RTFLastPageN
Else
ExportOptions.RTFExportAll
End If
Response.ContentType = "application/rtf"
Case "CRXF_XLS"
If CInt(exportType) = 10 Then
ExportOptions.FormatType = CREFTEXCELDATAONLY
Else
ExportOptions.FormatType = CREFTEXCEL
End If
GetExportPageRange startPage, endPage
If startPage > 0 Then
ExportOptions.ExcelExportA
ExportOptions.ExcelFirstPa
ExportOptions.ExcelLastPag
Else
ExportOptions.RTFExportAll
End If
Response.ContentType = "application/vnd.ms-excel"
Case "U2FXLS"
If CInt(exportType) = 10 Then
ExportOptions.FormatType = CREFTEXCELDATAONLY
Else
ExportOptions.FormatType = CREFTEXCEL
End If
GetExportPageRange startPage, endPage
If startPage > 0 Then
ExportOptions.ExcelExportA
ExportOptions.ExcelFirstPa
ExportOptions.ExcelLastPag
Else
ExportOptions.RTFExportAll
End If
Response.ContentType = "application/vnd.ms-excel"
Case "U2FCR"
ExportOptions.FormatType = CREFTCRYSTALREPORT
Response.ContentType = "application/x-rpt"
Case "CRXF_PDF"
ExportOptions.FormatType = CREFTPORTABLEDOCFORMAT
ExportOptions.PDFExportAll
GetExportPageRange startPage, endPage
If startPage > 0 Then
ExportOptions.PDFExportAll
ExportOptions.PDFFirstPage
ExportOptions.PDFLastPageN
Else
ExportOptions.PDFExportAll
End If
Response.ContentType = "application/pdf"
Case "U2FPDF"
ExportOptions.FormatType = CREFTPORTABLEDOCFORMAT
GetExportPageRange startPage, endPage
If startPage > 0 Then
ExportOptions.PDFExportAll
ExportOptions.PDFFirstPage
ExportOptions.PDFLastPageN
Else
ExportOptions.PDFExportAll
End If
Response.ContentType = "application/pdf"
Case Else
FillExportOptionsObject = False
Exit Function
End Select
ExportOptions.DestinationT
FillExportOptionsObject = True
else
FillExportOptionsObject = False
end if
end FUNCTION
'Helper function to get page range for exports.
Sub GetExportPageRange(ByRef startPage, ByRef endPage)
Dim exportOptions
exportOptions = Request.QueryString("expor
startPage = 0
endPage = 0
If exportOptions = "" Then
Exit Sub
End If
'The export_opt value is formatted as follows:
'[n-m] page n to m
'(-n] first page to n
'[n-) page n to the end
'(-) all pages
Dim i, dashIndex
dashIndex = findChar(exportOptions, "-")
If dashIndex = -1 Then
Exit Sub
End If
'Check for a starting page
i = findChar(exportOptions, "[")
If i <> -1 Then
startPage = Mid(exportOptions, i + 1, dashIndex - i - 1)
Else
startPage = 1
End If
'Check for an ending page
i = findChar(exportOptions, "]")
If i <> -1 Then
endPage = Mid(exportOptions, dashIndex + 1, i - dashIndex - 1)
Else
endPage = -1
End If
End Sub
' Helper function that returns the index of the character in the given string.
Function findChar(findStr, charToFind)
dim lenStr
dim result
lenStr = len(findStr)
result = -1
if(lenStr > 0) Then
charCounter = 1
do While(charCounter <= lenStr)
tmpChar = Mid(findStr,charCounter,1)
if(tmpChar = charToFind) Then
result = charCounter
Exit Do
end if
charCounter = charCounter + 1
loop
end if
findChar = result
End Function
%>
==========================
cleanup.asp
==========================
<HTML>
<HEAD>
<TITLE>Session Cleanup</Title>
</HEAD>
<BODY Onload="CallClose();">
<%
Function DestroyObjects(ByRef ObjectToDestroy)
If isobject(ObjectToDestroy) then
set ObjectToDestroy = nothing
'Not supported with IIS4, so ignore an error here.
On Error Resume Next
Session.Contents.Remove(Ob
On Error Goto 0
DestroyObjects = true
Else
DestroyObjects = false
End if
End Function
DestroyObjects(session("oP
DestroyObjects(session("oR
DestroyObjects(session("oA
%>
<SCRIPT LANGUAGE="Javascript">
function CallClose()
{
if ( location.toString().search
}
</SCRIPT>
</BODY>
</HTML>
<%
Session.Abandon
Response.End
%>
==========================
Place the 3 files in the same directory along with the rpt file and call the main file via the web server
Hope this helps
Gary