Hello,
I want using ASP to call reports (version Crystal Reports 8.5) in a local network. The reports based of a database on a sql-server. With the following code I can access of my reports, but I have this problem: in some reports I use crystal parameter fields, so that the user can set a select parameter, but it is not stringent necessary. (Only) the reports with parameter fields dont get displayed - no parameter field, no report. What can I do?
<%
' Get QS variables
rpttoview = request.querystring("rpt"
viewer = request.querystring("init"
'build full path for report
rpttoview = MID(request.ServerVariables("PATH_TRANSLATED",
1, (LEN(request.ServerVariables("PATH_TRANSLATED")-11)) &
"\myreportdirectory\" & rpttoview & ".rpt"
' build path to database
myConnStr="Driver={SQL
Server};server=myservername;PWD=userpassword;UID=username;
Database=databasename"
set conntemp=server.createobject("adodb.connection"
conntemp.open myConnStr
' Only create the Crystal Application Object on first time through
If Not IsObject ( session ("oApp") Then
Set session ("oApp" =
Server.CreateObject("Crystal.CRPE.Application"
End If
' Turn off all Error Message dialogs
Set oGlobalOptions = Session ("oApp".Options
oGlobalOptions.MorePrintEngineErrorMessages = 0
' Open the report
Set session("oRpt" = session("oApp".OpenReport(rpttoview)
' Turn off sepecific report error messages
Set oRptOptions = Session("oRpt".Options
oRptOptions.MorePrintEngineErrorMessages = 0
' Opening the page engine will cause the data to be read
Set session("oPageEngine" = session("oRpt".PageEngine
... (Now decide what viewer to create) ...
Thanks for your help.
dzu
I want using ASP to call reports (version Crystal Reports 8.5) in a local network. The reports based of a database on a sql-server. With the following code I can access of my reports, but I have this problem: in some reports I use crystal parameter fields, so that the user can set a select parameter, but it is not stringent necessary. (Only) the reports with parameter fields dont get displayed - no parameter field, no report. What can I do?
<%
' Get QS variables
rpttoview = request.querystring("rpt"
viewer = request.querystring("init"
'build full path for report
rpttoview = MID(request.ServerVariables("PATH_TRANSLATED",
1, (LEN(request.ServerVariables("PATH_TRANSLATED")-11)) &
"\myreportdirectory\" & rpttoview & ".rpt"
' build path to database
myConnStr="Driver={SQL
Server};server=myservername;PWD=userpassword;UID=username;
Database=databasename"
set conntemp=server.createobject("adodb.connection"
conntemp.open myConnStr
' Only create the Crystal Application Object on first time through
If Not IsObject ( session ("oApp") Then
Set session ("oApp" =
Server.CreateObject("Crystal.CRPE.Application"
End If
' Turn off all Error Message dialogs
Set oGlobalOptions = Session ("oApp".Options
oGlobalOptions.MorePrintEngineErrorMessages = 0
' Open the report
Set session("oRpt" = session("oApp".OpenReport(rpttoview)
' Turn off sepecific report error messages
Set oRptOptions = Session("oRpt".Options
oRptOptions.MorePrintEngineErrorMessages = 0
' Opening the page engine will cause the data to be read
Set session("oPageEngine" = session("oRpt".PageEngine
... (Now decide what viewer to create) ...
Thanks for your help.
dzu