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!

Server has not yet been opened

Status
Not open for further replies.

sbind77

Programmer
Oct 2, 2001
29
US
Hello

whenever i am opening a report using asp
i am getting an error

"Server has not yet been opened."

i just pasted my ASP code below

pl try to help me to come out of this problem

'===================================================='
<%
reportname = &quot;sumpagedone.rpt&quot;
dim oApp
dim oRpt

If Not IsObject (Session(&quot;oApp&quot;)) Then
Set Session(&quot;oApp&quot;) = Server.CreateObject(&quot;CrystalRuntime.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

On error resume next

Set Session(&quot;oRpt&quot;) = Session(&quot;oApp&quot;).OpenReport(path & reportname, 1)

If Err.Number <> 0 Then
Response.Write &quot;Error Occurred creating Report Object: &quot; & Err.Description
Set Session(&quot;oRpt&quot;) = nothing
Set Session(&quot;oApp&quot;) = nothing
Response.End
End If

Session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = False
Session(&quot;oRpt&quot;).EnableParameterPrompting = False
Session(&quot;oRpt&quot;).DiscardSavedData

set session(&quot;ParamCollection&quot;) = Session(&quot;oRpt&quot;).Parameterfields

set Param1 = session(&quot;ParamCollection&quot;).Item(1)
Call Param1.SetCurrentValue (CStr(&quot;1&quot;), 12)

set Param2 =session(&quot;ParamCollection&quot;).Item(2)
Call Param2.SetCurrentValue (CStr(&quot;2001&quot;), 12)

set Param4 =session(&quot;ParamCollection&quot;).Item(4)
Call Param4.SetCurrentValue (CStr(&quot;1&quot;), 12)

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

If Err.Number <> 0 Then
Response.Write &quot;Error Occurred Reading Records: &quot; & Err.Description
Set Session(&quot;oRpt&quot;) = nothing
Set Session(&quot;oApp&quot;) = nothing
Session.Abandon
Response.End
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

'viewer = Request.Form(&quot;Viewer&quot;)
viewer = ActiveX

If cstr(viewer) = &quot;ActiveX&quot; then
%>
<!-- #include virtual=&quot;/asp_include/SmartViewerActiveX.asp&quot; -->
<%
ElseIf cstr(viewer) = &quot;Netscape Plug-in&quot; then
%>
<!-- #include virtual=&quot;/asp_include/ActiveXPluginViewer.asp&quot; -->
<%
ElseIf cstr(viewer) = &quot;Java using Browser JVM&quot; then
%>
<!-- #include virtual=&quot;/asp_include/SmartViewerJava.asp&quot; -->
<%
ElseIf cstr(viewer) = &quot;Java using Java Plug-in&quot; then
%>
<!-- #include virtual=&quot;/asp_include/JavaPluginViewer.asp&quot; -->
<%
ElseIf cstr(viewer) = &quot;HTML Frame&quot; then
Response.Redirect(&quot;/asp_include/htmstart.asp&quot;)
Else
Response.Redirect(&quot;/asp_include/rptserver.asp&quot;)
End If
%>

'===========================================================

Thank You
sbind77
 
You haven't opened a connection to the database via Crystal. You probably need to use SetLogonInfo for the tables. Do a search at support.crystaldecisions.com for more information. Or do a search for it in one of the Crystal forums here on tek-tips.

Earme
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top