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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report does not sort from ASP. Please help

Status
Not open for further replies.

amutinu

Programmer
Oct 19, 2001
50
US
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) <> &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 & Path & reportname
Set Session(&quot;oRpt&quot;) = nothing
Set Session(&quot;oApp&quot;) = nothing
Session.Abandon
Response.End
End If

set crtable = session(&quot;oRpt&quot;).Database.Tables.Item(1)

crtable.SetLogonInfo &quot;EK_ManagerResearch&quot;, &quot;EK_ManagerResearch&quot;, cstr(userid), cstr(password)

session(&quot;oRpt&quot;).DiscardSavedData
session(&quot;oRpt&quot;).MorePrintEngineErrorMessages = False
session(&quot;oRpt&quot;).EnableParameterPrompting = False
set session(&quot;oSortC&quot;) = session(&quot;oRpt&quot;).RecordSortFields
session(&quot;oSortC&quot;).Add crAscendingOrder,&quot;{v_Report_ManagerMeeting.MeetingClass}&quot;

On Error Resume Next

session(&quot;oRpt&quot;).ReadRecords
 
In CR 8.0, I used 0 instead of crAscendingOrder:

session(&quot;oSortC&quot;).Add 0,&quot;{v_Report_ManagerMeeting.MeetingClass}&quot;

Hope this helps!
 
I've got a message for Err.Description of

Server not yet opened.

What does it mean? I'm doing things on my local which the server is localhost.

Any help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top