Here is the problem:
I'm building a report from scratch dynamicaly through ASP.
I'm adding a parameter field to it so once the report is shown in the viewer, the user would be prompted for values and will be able to filter on some fields.
Everything is working fine until I set EnableParameterPrompting = true - I need it in order to bring up the parameter dialogue screen:
The browser just hangs - no error messages. If I set it to false, the report shows in the viewer as it supposed to but no prompting, of course. The parameter is there - I can see it if I export the report in Crystal format and open it in the Designer.
Any idea how to fix it?
Thanks in advance.
(Crystal 8.5, SQL Server 2000)
Here is my code:
<%
set session("oConn"
=server.CreateObject("ADODB.Connection"
set session("oCmd"
=server.CreateObject("ADODB.Command"
strConn = "Provider=SQLOLEDB;Data Source=MYPC;Initial Catalog=test_db;User Id=sa;Password=;"
session("oConn"
.Open(strConn)
session("oCmd"
.ActiveConnection = session("oConn"
session("oCmd"
.CommandText = "Select cmp_city, cmp_state, cmp_zip From Company"
If Not IsObject (session("oApp"
Then
Set session("oApp"
= Server.CreateObject("CrystalRuntime.Application"
End If
If IsObject(session("oRpt"
) then
Set session("oRpt"
= nothing
End if
set session("oRpt"
= session("oApp"
.NewReport
Set objDatabase = session("oRpt"
.Database
objDatabase.AddADOCommand session("oConn"
, session("oCmd"
'-------------------------------------------------
'-- Code to add fields to Detail Section goes here
'-------------------------------------------------
'this line hangs the browser
'session("oRpt"
.EnableParameterPrompting = true
'this works fine
session("oRpt"
.EnableParameterPrompting = false
set objParm = session("oRpt"
.ParameterFields.Add("parm1", 12)
session("oRpt"
.RecordSelectionFormula = "{ado.cmp_city}={?parm1}"
On Error Resume Next
session("oRpt"
.ReadRecords
if Err.Number <> 0 Then
Response.Write "Read Records Didn't Go"
else
if IsObject(session("oPageEngine"
) Then
set session("oPageEngine"
= nothing
end If
set session("oPageEngine"
= session("oRpt"
.PageEngine
end if
%>
<!-- #include file="SmartViewerActiveX.asp" -->
I'm building a report from scratch dynamicaly through ASP.
I'm adding a parameter field to it so once the report is shown in the viewer, the user would be prompted for values and will be able to filter on some fields.
Everything is working fine until I set EnableParameterPrompting = true - I need it in order to bring up the parameter dialogue screen:
The browser just hangs - no error messages. If I set it to false, the report shows in the viewer as it supposed to but no prompting, of course. The parameter is there - I can see it if I export the report in Crystal format and open it in the Designer.
Any idea how to fix it?
Thanks in advance.
(Crystal 8.5, SQL Server 2000)
Here is my code:
<%
set session("oConn"
set session("oCmd"
strConn = "Provider=SQLOLEDB;Data Source=MYPC;Initial Catalog=test_db;User Id=sa;Password=;"
session("oConn"
session("oCmd"
session("oCmd"
If Not IsObject (session("oApp"
Set session("oApp"
End If
If IsObject(session("oRpt"
Set session("oRpt"
End if
set session("oRpt"
Set objDatabase = session("oRpt"
objDatabase.AddADOCommand session("oConn"
'-------------------------------------------------
'-- Code to add fields to Detail Section goes here
'-------------------------------------------------
'this line hangs the browser
'session("oRpt"
'this works fine
session("oRpt"
set objParm = session("oRpt"
session("oRpt"
On Error Resume Next
session("oRpt"
if Err.Number <> 0 Then
Response.Write "Read Records Didn't Go"
else
if IsObject(session("oPageEngine"
set session("oPageEngine"
end If
set session("oPageEngine"
end if
%>
<!-- #include file="SmartViewerActiveX.asp" -->