Hello All,
I am using ASP and crystal Reports 8.5 Developers Edition to run my reports. I am connecting to crystal reports using ODBC. The reports comes up fine but when i try to sort the report, it doesn't do anything and the report displays as before.
The following code is used to sort the report. Please let me know what i am doing wrong. I would really appreciate your quick feedback
thanks
If Not IsObject (session("oApp") Then
Set session("oApp" = Server.CreateObject("CrystalRuntime.Application"
End If
Path = Request.ServerVariables("PATH_TRANSLATED"
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt") then
Set session("oRpt" = nothing
End if
On error resume next
Set session("oRpt" = session("oApp".OpenReport(Path & reportname, 1)
If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description & Path & reportname
Set Session("oRpt" = nothing
Set Session("oApp" = nothing
Session.Abandon
Response.End
End If
set crtable = session("oRpt".Database.Tables.Item(1)
crtable.SetLogonInfo "EK_ManagerResearch", "EK_ManagerResearch", cstr(userid), cstr(password)
session("oRpt".DiscardSavedData
session("oRpt".MorePrintEngineErrorMessages = False
session("oRpt".EnableParameterPrompting = False
set session("oSortC" = session("oRpt".RecordSortFields
session("oSortC".Add crAscendingOrder,"{v_Report_ManagerMeeting.MeetingClass}"
On Error Resume Next
session("oRpt".ReadRecords
I am using ASP and crystal Reports 8.5 Developers Edition to run my reports. I am connecting to crystal reports using ODBC. The reports comes up fine but when i try to sort the report, it doesn't do anything and the report displays as before.
The following code is used to sort the report. Please let me know what i am doing wrong. I would really appreciate your quick feedback
thanks
If Not IsObject (session("oApp") Then
Set session("oApp" = Server.CreateObject("CrystalRuntime.Application"
End If
Path = Request.ServerVariables("PATH_TRANSLATED"
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt") then
Set session("oRpt" = nothing
End if
On error resume next
Set session("oRpt" = session("oApp".OpenReport(Path & reportname, 1)
If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description & Path & reportname
Set Session("oRpt" = nothing
Set Session("oApp" = nothing
Session.Abandon
Response.End
End If
set crtable = session("oRpt".Database.Tables.Item(1)
crtable.SetLogonInfo "EK_ManagerResearch", "EK_ManagerResearch", cstr(userid), cstr(password)
session("oRpt".DiscardSavedData
session("oRpt".MorePrintEngineErrorMessages = False
session("oRpt".EnableParameterPrompting = False
set session("oSortC" = session("oRpt".RecordSortFields
session("oSortC".Add crAscendingOrder,"{v_Report_ManagerMeeting.MeetingClass}"
On Error Resume Next
session("oRpt".ReadRecords