CrystalUser1
Programmer
Hi,
We are using crystal reports 8.5 and oracle 10g. Created reports using ODBC. We are calling the reports from the web environment and the asp file invokes the report. Recently i created a report which has a sub report. How to pass the user id and password credentials to the sub report. My Asp file is copied below: what should be added in the following file to pass the user id and password to the sub report without prompting that when invoking the report.
thanks
<HTML>
<HEAD>
<TITLE>Crystal Report Viewer</TITLE>
</HEAD>
<SCRIPT SRC="ftCommonArea.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var rptName = "<%= Request.QueryString("report") %>"
</SCRIPT>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript>
<FORM>
<INPUT type="button" value="Back to Employee Reports Menu"
onClick="window.close() ; ">
</FORM>
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
WIDTH=100% HEIGHT=95%
CODEBASE="<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=0>
<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 Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if err.number <> 0 then
window.alert "The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available at Microsoft's web site."
CRViewer.ReportName = rptPath+rptName
else
Dim webSource0
Set webSource0 = CreateObject("WebReportSource.WebReportSource")
webSource0.ReportSource = webBroker
webSource0.URL = rptPath + rptName
webSource0.PromptOnRefresh = True
webSource0.AddParameter "user0", rptUserID
webSource0.AddParameter "password0", rptPassword
<%
dim numParm
numParm = 0
numParm = Int(Request.QueryString("nParms"))
numParm = Int(numParm) - 1
For i = 0 to numParm
name = "prompt" & i
value = Request.QueryString(name)
Response.write "webSource0.AddParameter """ & name & """, """ & value &"""" & vbcrlf
Next
%>
webSource0.AddParameter "promptOnRefresh", "1"
CRViewer.ReportSource = webSource0
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</body>
</html>
We are using crystal reports 8.5 and oracle 10g. Created reports using ODBC. We are calling the reports from the web environment and the asp file invokes the report. Recently i created a report which has a sub report. How to pass the user id and password credentials to the sub report. My Asp file is copied below: what should be added in the following file to pass the user id and password to the sub report without prompting that when invoking the report.
thanks
<HTML>
<HEAD>
<TITLE>Crystal Report Viewer</TITLE>
</HEAD>
<SCRIPT SRC="ftCommonArea.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
var rptName = "<%= Request.QueryString("report") %>"
</SCRIPT>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript>
<FORM>
<INPUT type="button" value="Back to Employee Reports Menu"
onClick="window.close() ; ">
</FORM>
<OBJECT ID="CRViewer"
CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
WIDTH=100% HEIGHT=95%
CODEBASE="<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=0>
<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 Page_Initialize
On Error Resume Next
Dim webBroker
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
if err.number <> 0 then
window.alert "The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available at Microsoft's web site."
CRViewer.ReportName = rptPath+rptName
else
Dim webSource0
Set webSource0 = CreateObject("WebReportSource.WebReportSource")
webSource0.ReportSource = webBroker
webSource0.URL = rptPath + rptName
webSource0.PromptOnRefresh = True
webSource0.AddParameter "user0", rptUserID
webSource0.AddParameter "password0", rptPassword
<%
dim numParm
numParm = 0
numParm = Int(Request.QueryString("nParms"))
numParm = Int(numParm) - 1
For i = 0 to numParm
name = "prompt" & i
value = Request.QueryString(name)
Response.write "webSource0.AddParameter """ & name & """, """ & value &"""" & vbcrlf
Next
%>
webSource0.AddParameter "promptOnRefresh", "1"
CRViewer.ReportSource = webSource0
end if
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</body>
</html>