Dear friends,
Can you please help me making a report in Crystal Report from ASP. I'm using ASP(developed in Visual Interdev), SQL Server 2000(RDBMS) and Crystal Report 7.0. I created the report using the following code.
<html>
<head>
<title>Login Page</title>
</head>
<BODY bgColor=#c6c6c6 language=VBScript>
<OBJECT classid=CLSID:C4847596-972C-11D0-9567-00A0C9273C2A
codeBase=/viewer/activeXViewer/activexviewer.cab#Version=7,0,0,371 height="95%"
id=CRViewer width="100%"><PARAM NAME="EnableDrillDown" VALUE="1"><PARAM NAME="EnableExportButton" VALUE="1"><PARAM NAME="DisplayGroupTree" VALUE="1"><PARAM NAME="EnableGroupTree" VALUE="1"><PARAM NAME="EnableAnimationControl" VALUE="1"><PARAM NAME="EnablePrintButton" VALUE="1"><PARAM NAME="EnableRefreshButton" VALUE="1"><PARAM NAME="EnableSearchControl" VALUE="1"><PARAM NAME="EnableZoomControl" VALUE="1"><PARAM NAME="EnableSearchExpertButton" VALUE="0"><PARAM NAME="EnableSelectExpertButton" VALUE="0"></OBJECT>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub window_onLoad()
Page_Initialize()
End Sub
Sub window_onLoad()
Page_Initialize()
End Sub
Sub Page_Initialize
On Error Resume Next
dim var_ilp_id
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
Dim webSource0
Set webSource0 = CreateObject("WebReportSource.WebReportSource")
webSource0.ReportSource = webBroker
webSource0.URL ="http://localhost/rptAll.rpt?dsn0=student&user0=sa&password0=&dsq0=S tudent"
webSource0.PromptOnRefresh =false
CRViewer.DisplayGroupTree=false
CRViewer.ReportSource = webSource0
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</BODY>
</html>
It's working fine.It shows all the records.
But if I want to see the record for a particular StudentId, then what to do. Usually in
VB I added the part below-
RPT1.SelectionFormula="{Table.Field}"=& cDbl(StudentId)
But in CRviewer I tried with the part
dim x
x=InputBox("Enter the Student No")
CRViewer.SearchByFormula("{Table.Field}")=& cDbl(StudentId)
Even if it didn't work.Can you please give me a hint. I'll be ever grateful to you.
RONb