RAS CE9 no longer provides password storage, like CE8 does. To avoid the prompt for username and password when running a report, just store the password in the ODBC registry entry using the string name "Password". Note that this works for CR9 also.
I no longer have CE8 and CR8.5 installed, but I would guess that these versions also try to read the ODBC password from the registry (like reading the ODBC username), then prompt if the password is not found.
I've tried this approach and it doesn't seem to work. Our reports still pop up the Database Logon screen with a request for a User Id and Password. Were you able to store the User Id in the registry as well? How does the InteractiveViewer.asp file know to look in the registry for these values?
I found a way in to modify your viewers code to harcode the password and login name so it doesn't prompt your users. This is taken from another thread. it worked great for me and i used it in both the interactive and page viewer asp files. good luck!
Dean
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"
<%@ 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"
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
%>
to my InteractiveViewer.asp file as well as the partsviewer and pageviewer files, but it didn't seem to work. I still get prompted for this info. Got any further advice? I am using CE9 RAS ePortfolio Lite, BTW.
Below is the exact code from my pageviewer.asp file. just type in your username and password and see if that works. Our database server is MS SQL. I'm not sure this works the same way for other db servers. i would copy the code exaclty line for line if you can.
<%@ 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
Dim objectFactory
Set objectFactory = CreateObject("CrystalReports.ObjectFactory.2"
Response.ExpiresAbsolute = Now() - 1
Dim viewer
Set viewer = objectFactory.CreateObject("CrystalReports.CrystalReportViewer"
viewer.Name = "page"
viewer.IsOwnForm = true
viewer.IsOwnPage = true
I copied in your entire pageviewer.asp file and still no luck. Maybe I would also need your complete interactiveviewer.asp and partsviewer.asp files for it to work? I did notice in editing my files that there were some small differences between our files.
Just for clarification, you are talking about the files in the "reports" directory on the RAS server, right?
yes it's for reports in the reports directory listed in the RAS configuration utility. I'm not sure i can help you if this is not working, i'm no expert myself, but this worked for me. if there is any difference in your file to my file, send me what your pageviewer.asp looks like and maybe i can spot the difference, if they are identical, then you might have other issues. I force my users to use the pageviewer.asp so i'm not using the interactive viewer but i tested it and it also worked.
This is what my pageviewer.asp file looks like (with the username and password marked out):
<%@ 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
Dim objectFactory
Set objectFactory = CreateObject("CrystalReports.ObjectFactory.2"
Response.ExpiresAbsolute = Now() - 1
Dim viewer
Set viewer = objectFactory.CreateObject("CrystalReports.CrystalReportViewer"
viewer.Name = "page"
viewer.IsOwnForm = true
viewer.IsOwnPage = true
the script looks correct. Are you connecting to a SQL database via an ODBC data source?
when you are prompted for a username and password, when you type it in manually, doesn't it process the report correctly? if it's a case sensitive password you have to type it exactly that way in the asp file with quotes around it. other than that, i'm at a loss. Sorry
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.