Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRYSTAL 10 ACTIVE X QUESTION !!

Status
Not open for further replies.

grom71

IS-IT--Management
Oct 23, 2003
56
GB
Hi,
I've got the Active X vewier supplied with CR10 developer to work with .asp web pages. The report displays fine and the buttons all work...(the files and samplecode found within the aspxmps10.exe downloaded from BO..)

However my question is this...
I'm now using it with my reports however I cant get the parameters to work.
What I mean is that I've created a parameter in Crystal which the user would need to enter by selecting from a list, or enter a date range etc.
BUT when you click the refresh button instead of getting the "parameter" window (which you get in Crystal) it goes off to the database and gets all records..

Is there any way this can be set up ?




The HTML code which passes the cab file is here....





<%
'This file contains the HTML code to instantiate the Smart Viewer ActiveX.
'
'You will notice that the Report Name parameter references the RDCrptserver10.asp file.
'This is because the report pages are actually created by RDCrptserver10.asp.
'RDCrptserver10.asp accesses session("oApp"), session("oRpt") and session("oPageEngine")
'to create the report pages that will be rendered by the ActiveX Smart Viewer.
'
%>
<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-8AAA-4a3e-8869-1DA509E8A011"
WIDTH=100% HEIGHT=99%
CODEBASE="/crystalreportviewers10/ActiveXControls/ActiveXViewer.cab#Version=10,0,0,280" VIEWASTEXT>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_Onload
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("CrystalReports10.WebReportBroker.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("CrystalReports10.WebReportSource.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>
 
I have the same issue and I cannot figure it out. However, I believe it has to do with the code delivered by Crystal into the RDCrptserver10.asp program.

Into the Refresh section, it has the property EnableParameterPrompting set to false. See below.

-------
Case "RFSH"

' This command forces the database to be read again.
session("oRpt").DiscardSavedData
If Err.Number <> 0 Then
Call CheckForError
Else
session("oRpt").EnableParameterPrompting = false
session("oRpt").ReadRecords
Set session("oPageEngine") = session("oRpt").PageEngine
End If
------

I have tried to set it to true but then the refresh button hangs.

A work around is to setup a HTML page with a form to capture the parameters and then pass those parameters at the same place where you pass the DB connection (within the MoreRequiredSteps.asp program). See Below:
-------
' Set the report selection parameters
Set ParameterFields = session("oRpt").ParameterFields
Set ParameterField = ParameterFields.Item(1)
ParameterField.SetCurrentValue "B"

'Set report database connection
'Set the Connection Info to Connection Properties of the table object
Set ConnectionInfo = session("oRpt").Database.Tables(1).ConnectionProperties
ConnectionInfo.Item("DSN") = "XXXXX"
ConnectionInfo.Item("Database") = "XXXX"
ConnectionInfo.Item("User ID") = "XXXXX"
ConnectionInfo.Item("Password") = "XXXXX"

session("oRpt").ReadRecords
-------

If you have any solution that let you use the standard Crystal viewer prompt, please let me know.

Syfaure.
 
Hi

We were using asp pages and crystal reports in Crystal 8.5 version. We were installing 'npviewer' on each client computer to view reports.

Now we have installed Crystal enterprise embedded and CR10 on IIS server (Windows 2000).

What is equivelant to 'npviewer' on client computer in CR10 to view reports? Where do we get it? where do we install it?

Thanks.

Ajay



 
Hmm. Have you guys tried making sure that you have no saved data with the report?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top