p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

crystal_reports thread: Using CR in ASP application

Message #1 by "Bruce Haan" <bpa.haan@s...> on Thu, 12 Apr 2001 02:33:14
My boss just asked me to develope an ASP application and wants the users 

to be able to print reports using Crystal Reports.  I need help in finding 

resources on printing CR from an ASP, since I have not done this before.  

Any help would be appreciated.
Message #2 by "Muraleedharan.V" <murali_vm@u...> on Wed, 18 Apr 2001 08:04:25

You need to configure CR Page Server first.

Here is the example ;


Response.Expires = 0



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)                                               




If IsObject(session("oRpt")) then

	Set session("oRpt") = nothing

End if

Set session("oRpt") = session("oApp").OpenReport(path 

& "rptReservations.rpt", 1)

session("oRpt").MorePrintEngineErrorMessages = False

session("oRpt").EnableParameterPrompting = False


set ReportDatabase =  session("oRpt").Database

set crdatabasetables =ReportDatabase.tables

set crtable = crdatabasetables.Item(1)

crtable.SetLogonInfo "Landoncore","core","team1","cochin"



  Return to Index