Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

I have multiple reports in a web ap

I have multiple reports in a web ap

I have multiple reports in a web ap

I have multiple reports in a web application.  I can view them all and print them, no problem.  There's on report that I don't want to view, I just want it to print.  But it just hangs there.
This is the code:

dim reportname, Path, iLen
reportname = "report.rpt"
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                                                        'OPEN THE REPORT (but destroy any previous one first)
If IsObject(session("oRpt")) then
  Set session("oRpt") = nothing
End if
On error resume next
Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)
'This line uses the "PATH" and "reportname" variables to reference the Crystal
'Report file, and open it up for processing.
If Err.Number <> 0 Then
  Response.write "Error Occurred creating Report Object: " & Err.Description
  Set Session("oRpt") = nothing
  Set Session("oApp") = nothing
End If
session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
session("oRpt").RecordSelectionFormula = "{MASTER.OrderNo} = " & intOrderNum
On Error Resume Next
If Err.Number <> 0 Then   
  Response.write "Error Occurred Reading Records: " & Err.Description & vbcrlf
  Set Session("oRpt") = nothing
  Set Session("oApp") = nothing

  If IsObject(session("oPageEngine"))Then
    set session("oPageEngine") = nothing
  End If
  set session("oPageEngine") = session("oRpt").PageEngine
End If
session("oRpt").PrintOut true,1
If Err.Number <> 0 Then
 Response.Write "Error Occurred Printing: " & Err.Description & vbcrlf
  Set Session("oRpt") = nothing
  Set Session("oApp") = nothing

End If

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close