I am developing an web application that uses crystal reports to view a specific data from a database. I am using IIS 5 Win2k, SQL2k, and Crystal 8.5. I can't seem to find any documentation on this issue. The code I have so far doesn't work. I tried tweaking the sample code provided by crystal but no luck. Here is the code I have so far. Does anyone know what I have to change or add to make it work.
Thanks you,
Sung
<%
dim servername
dim reportname
dim objRS
dim objConn
set objConn = createobject("ADODB.Connection"
objConn.connectionstring = <some string>
Set objCmd = server.CreateObject("ADODB.Command"
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "SOMETABLE"
objCmd.CommandType = adCmdTable
If Not IsObject (session("oApp") Then
Set session("oApp" = Server.CreateObject("CrystalRuntime.Application"
End If
If IsObject(session("oRpt") then
Set session("oRpt" = nothing
End if
On error resume next
Set session("oRpt" = session("oApp".NewReport
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".MorePrintEngineErrorMessages = False
session("oRpt".EnableParameterPrompting = False
Set Database = session("oRpt".Database
Set Tables = Database.Tables
'**** I am LOST RIGHT ABOUT HERE ****'
session("oRpt".Database.AddADOCommand objConn, objCmd
'Set FirstTable = Tables.Item(1)
On Error Resume Next
session("oRpt".ReadRecords
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt" = nothing
Set Session("oApp" = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEngine") Then
set session("oPageEngine" = nothing
End If
set session("oPageEngine" = session("oRpt".PageEngine
End If
%>
<!-- #include file="SmartViewerActiveX.asp" -->
Thanks you,
Sung
<%
dim servername
dim reportname
dim objRS
dim objConn
set objConn = createobject("ADODB.Connection"
objConn.connectionstring = <some string>
Set objCmd = server.CreateObject("ADODB.Command"
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "SOMETABLE"
objCmd.CommandType = adCmdTable
If Not IsObject (session("oApp") Then
Set session("oApp" = Server.CreateObject("CrystalRuntime.Application"
End If
If IsObject(session("oRpt") then
Set session("oRpt" = nothing
End if
On error resume next
Set session("oRpt" = session("oApp".NewReport
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".MorePrintEngineErrorMessages = False
session("oRpt".EnableParameterPrompting = False
Set Database = session("oRpt".Database
Set Tables = Database.Tables
'**** I am LOST RIGHT ABOUT HERE ****'
session("oRpt".Database.AddADOCommand objConn, objCmd
'Set FirstTable = Tables.Item(1)
On Error Resume Next
session("oRpt".ReadRecords
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt" = nothing
Set Session("oApp" = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEngine") Then
set session("oPageEngine" = nothing
End If
set session("oPageEngine" = session("oRpt".PageEngine
End If
%>
<!-- #include file="SmartViewerActiveX.asp" -->