JayCrowe
asked on
CRViewer ActiveX via ASP will not prompt for parameter fields
This upgrade to CR10 viewer via ASP has been kicking my butt. My current dilemma is that I can not get a parameter dialog to pop up no matter what I do.
My report has nothing on it but a text label and a paramter field just as a test. (not even trying to hook to a DB)
It does not have the 'Save data with report' checked.
I have only CRViewer v10 on the server and client, including reportparameterdialog.dll. It is registered.
If I change:
session("oRpt").EnablePara meterPromp ting = False
to
session("oRpt").EnablePara meterPromp ting = True
the ASP page hangs during the load. It seems to hang the web server real good... I'm rebooting it now.
If I leave it set to false, my report will load with the default value I put in my param field. (no prompt). If I hit refresh, it loads a null value (no prompt).
I downloaded a test ASP & rpt from Crystal support that forces parameter values in during load and that works fine. When I hit 'refresh' I just get null values back, no prompt.
I ususally end up figuring this stuff out on my own shortly after posting to EE. I hope that is the case with this issue as well! :o)
Thanks in advance for any help you can provide.
Here is my ASP code. There is also an asscociated RDCrptserver10.asp that is default right from Crystal. I will post it if necessary, but it is rather long.
<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Expires = -1
Response.CacheControl = "no-cache"
reportname = "Jay.rpt"
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("Cryst alRuntime. Applicatio n.10")
End If
Path = Request.ServerVariables("P ATH_TRANSL ATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt")) then Set session("oRpt") = nothing
Set session("oRpt") = session("oApp").OpenReport (path & reportname, 1)
If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
End If
'session("oRpt").MorePrint EngineErro rMessages = False
session("oRpt").EnablePara meterPromp ting = True
session("oRpt").DiscardSav edData
session("oRpt").ReadRecord s
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEng ine")) Then Set session("oPageEngine") = nothing
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
<HTML>
<HEAD>
<TITLE>Crystal Reports ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
CLASSID="CLSID:A1B8A30B-8A AA-4a3e-88 69-1DA509E 8A011"
WIDTH=100% HEIGHT=95%
CODEBASE="/crystalreportvi ewers10/Ac tiveXContr ols/Active XViewer.ca b#Version= 10,0,0,280 " VIEWASTEXT>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationContr ol" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
'On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("CrystalRepor ts10.WebRe portBroker .1")
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
else
Dim webSource
Set webSource = CreateObject("CrystalRepor ts10.WebRe portSource .1")
webSource.ReportSource = webBroker
webSource.URL = "RDCrptserver10.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
<script language="javascript">
function CallDestroy()
{
window.open("Cleanup.asp") ;
}
</script>
</BODY>
</HTML>
My report has nothing on it but a text label and a paramter field just as a test. (not even trying to hook to a DB)
It does not have the 'Save data with report' checked.
I have only CRViewer v10 on the server and client, including reportparameterdialog.dll.
If I change:
session("oRpt").EnablePara
to
session("oRpt").EnablePara
the ASP page hangs during the load. It seems to hang the web server real good... I'm rebooting it now.
If I leave it set to false, my report will load with the default value I put in my param field. (no prompt). If I hit refresh, it loads a null value (no prompt).
I downloaded a test ASP & rpt from Crystal support that forces parameter values in during load and that works fine. When I hit 'refresh' I just get null values back, no prompt.
I ususally end up figuring this stuff out on my own shortly after posting to EE. I hope that is the case with this issue as well! :o)
Thanks in advance for any help you can provide.
Here is my ASP code. There is also an asscociated RDCrptserver10.asp that is default right from Crystal. I will post it if necessary, but it is rather long.
<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Expires = -1
Response.CacheControl = "no-cache"
reportname = "Jay.rpt"
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("Cryst
End If
Path = Request.ServerVariables("P
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt")) then Set session("oRpt") = nothing
Set session("oRpt") = session("oApp").OpenReport
If Err.Number <> 0 Then
Response.Write "Error Occurred creating Report Object: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
End If
'session("oRpt").MorePrint
session("oRpt").EnablePara
session("oRpt").DiscardSav
session("oRpt").ReadRecord
If Err.Number <> 0 Then
Response.Write "Error Occurred Reading Records: " & Err.Description
Set Session("oRpt") = nothing
Set Session("oApp") = nothing
Session.Abandon
Response.End
Else
If IsObject(session("oPageEng
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
<HTML>
<HEAD>
<TITLE>Crystal Reports ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 ONUNLOAD="CallDestroy();" leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>
<OBJECT ID="CRViewer"
CLASSID="CLSID:A1B8A30B-8A
WIDTH=100% HEIGHT=95%
CODEBASE="/crystalreportvi
<PARAM NAME="EnableRefreshButton"
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=0>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl"
<PARAM NAME="EnableAnimationContr
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
'On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("CrystalRepor
if ScriptEngineMajorVersion < 2 then
window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
else
Dim webSource
Set webSource = CreateObject("CrystalRepor
webSource.ReportSource = webBroker
webSource.URL = "RDCrptserver10.asp"
webSource.PromptOnRefresh = True
CRViewer.ReportSource = webSource
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
<script language="javascript">
function CallDestroy()
{
window.open("Cleanup.asp")
}
</script>
</BODY>
</HTML>
ASKER
Thanks mlmcc. I already have those samples, that's where the majority of the above code came from.
To clarify my issue, I don't want to send parameters via code, I want the default CRViewer parameter prompt to show up.
I cannot get the prompt to show up. Most posts I read people complain they can't get rid of the thing. hah.
Also, I'm not even sure if this is a server or client issue? It seems that it would be the client, but I'm no expert.
Thanks.
To clarify my issue, I don't want to send parameters via code, I want the default CRViewer parameter prompt to show up.
I cannot get the prompt to show up. Most posts I read people complain they can't get rid of the thing. hah.
Also, I'm not even sure if this is a server or client issue? It seems that it would be the client, but I'm no expert.
Thanks.
Do the parameters have valid default values?
I am not familiar with ASP code, though nothing looks wrong.
mlmcc
I am not familiar with ASP code, though nothing looks wrong.
mlmcc
ASKER
I do have a default value for the parameter field, and even that does not show up when I open the report.
I don't suspect the ASP is the culprit, although this is the first time I have worked with ASP. I more or less am using the Crystal demo ASP code.
It seems to me that there is something missing in relation to the reportparameterprompt.dll but I can't figure it out.
*ugh*
I don't suspect the ASP is the culprit, although this is the first time I have worked with ASP. I more or less am using the Crystal demo ASP code.
It seems to me that there is something missing in relation to the reportparameterprompt.dll but I can't figure it out.
*ugh*
ASKER
And the answer is:
The information in the article refers to:
Crystal Reports 10
The RDC parameter dialog box will not appear in the ASP application since the ASP application does not support the RDC parameter dialog box.
http://support.businessobjects.com/library/kbase/articles/c2015774.asp
That just stinks. It does work via VB6. I don't know anything about ASP.NET, but I think this this can be made to work that way.
Back to the drawing board.
The information in the article refers to:
Crystal Reports 10
The RDC parameter dialog box will not appear in the ASP application since the ASP application does not support the RDC parameter dialog box.
http://support.businessobjects.com/library/kbase/articles/c2015774.asp
That just stinks. It does work via VB6. I don't know anything about ASP.NET, but I think this this can be made to work that way.
Back to the drawing board.
ASKER
I paid $200 (price of one tech support call) for Business Solutions to tell me I could not use the CR10 ActiveX viewer via ASP to run rerports WITH parameter prompts. Works fine with reports that have no parameter fields. They said i would need to purchase a RAS server (report application server? I forget now) with the appropriate licenses to do what I wanted.
That was BS, I was able to get things working via ASP.NET with only CR10 Developer edition. It doesn't use the ActiveX viewer, it renders the reports using an html type viewer. Everything works, export, print, parameter prompts, etc. I set it up so I can pass the name of the report I want and the necessary usrname and password, then the page loads and the parameter fileds pop up. It even has a calendar date picker window that pops up instead of having to type in the goofy CR date format directly. When you print reports, it actually spawns an Adobe Acrobat window containing the report, then you hit print from there.
I hope this info will help others.
That was BS, I was able to get things working via ASP.NET with only CR10 Developer edition. It doesn't use the ActiveX viewer, it renders the reports using an html type viewer. Everything works, export, print, parameter prompts, etc. I set it up so I can pass the name of the report I want and the necessary usrname and password, then the page loads and the parameter fileds pop up. It even has a calendar date picker window that pops up instead of having to type in the goofy CR date format directly. When you print reports, it actually spawns an Adobe Acrobat window containing the report, then you hit print from there.
I hope this info will help others.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://support.businessobjects.com/communityCS/FilesAndUpdates/aspxmps10.exe.asp
mlmcc