I’ve adapted the ePortfolio Lite interactiveViewer.asp file to include our Oracle Database connection so I don’t have to login every time.
Using the URL I can tell the RAS what report I want to open and it will only prompt for the parameters because I’ve already issued the connection string.
The URL looks like this:
http:\\RAS\cr\interactiveViewer.asp?reportname=drawing bom.rpt
The only thing you’ve got to add is the following:
Dim userName, password
userName = "your_username"
password = "your_password"
clientDoc.DatabaseController.Logon username, password
Hope this helps.
Rob
Here's the full interactiveViewer.asp file ...
<%@ Language=VBScript CodePage=65001 ENABLESESSIONSTATE = False %>
<% Option Explicit
' Note - the CodePage=65001 is needed to display Unicode text correctly in the viewer
' if Session is null for ProcessHttpRequest
'1. Create the ObjectFactory to instantiate Crystal Objects
Dim objectFactory
Set objectFactory = CreateObject("CrystalReports.ObjectFactory.2"
Response.ExpiresAbsolute = Now() - 1
'2. Create Viewer
Dim viewer
Set viewer = objectFactory.CreateObject("CrystalReports.CrystalReportInteractiveViewer"
viewer.Name = "page"
viewer.IsOwnForm = true
viewer.IsOwnPage = true
'3. Get the Report
Dim theReportName
theReportName = Request.Form("ReportName"

if theReportName = "" then theReportName = Request.QueryString("ReportName"

viewer.URI = "interactiveViewer.asp?ReportName=" + Server.URLEncode(theReportName)
'4. Create the ReportClientDocument
Dim clientDoc
Set clientDoc = objectFactory.CreateObject("CrystalClientDoc.ReportClientDocument"

clientDoc.Open theReportName
'5. User name and Password Variables
Dim userName, password
userName = "your_username"
password = "your_password"
clientDoc.DatabaseController.Logon username, password
viewer.ReportSource = clientDoc.ReportSource
'viewer.EnableLogonPrompt = false
Dim BooleanSearchControl
Set BooleanSearchControl = objectFactory.CreateObject("CrystalReports.BooleanSearchControl"

BooleanSearchControl.ReportDocument = clientDoc
viewer.BooleanSearchControl = BooleanSearchControl
viewer.ProcessHttpRequest Request, Response, Null
' ReportClientDocument will be automatically closed when clientDoc is released
%>