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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database connection with ePortfolio Lite 2

Status
Not open for further replies.

tommmo

ISP
Sep 9, 2002
5
0
0
SI
I would like to insert username and password for connecting to Oracle Database in my reports, so I don't need to input them everytime I run reports from ePortfolio Lite.
At the present moment I get this error after I insert parameters for report:
The database logon was not successful. Please re-enter your logon information and try again.
Is it possible to store usrename/password for database connection in report?
I'm using Crystal Reports 9
 
ok, we've been looking everywhere for the same thing. if you find the answer can you be sure to post it here. thanks
 
The user name\password can be inserted through the CMC Manager Objects option.

But, you might want to check the compatibility of reports created in Crystal Reports 9.0 running on Crystal Enterprises 8.5. We were told not to upgrade to CR 9.0 because those reports wouldn't work on CE 8.5....

 
I'm having the same problem, the ePortfolio don't want to log into my database, please notify me if you find and answer
 
You need to configure your DNS correctly to NOT use the NT authentication.

I suggest you to create a new dns to your database that uses SQL server authentication (or whatever your server is), and disable the integrated security. Then point your reports to this new DNS.

Also, your server has to be configured to accept "Mixed" connections and not only "NT Authentication"
 
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(&quot;CrystalReports.ObjectFactory.2&quot;)

Response.ExpiresAbsolute = Now() - 1

'2. Create Viewer
Dim viewer
Set viewer = objectFactory.CreateObject(&quot;CrystalReports.CrystalReportInteractiveViewer&quot;)
viewer.Name = &quot;page&quot;
viewer.IsOwnForm = true
viewer.IsOwnPage = true

'3. Get the Report
Dim theReportName
theReportName = Request.Form(&quot;ReportName&quot;)
if theReportName = &quot;&quot; then theReportName = Request.QueryString(&quot;ReportName&quot;)
viewer.URI = &quot;interactiveViewer.asp?ReportName=&quot; + Server.URLEncode(theReportName)

'4. Create the ReportClientDocument
Dim clientDoc
Set clientDoc = objectFactory.CreateObject(&quot;CrystalClientDoc.ReportClientDocument&quot;)
clientDoc.Open theReportName

'5. User name and Password Variables
Dim userName, password
userName = &quot;your_username&quot;
password = &quot;your_password&quot;

clientDoc.DatabaseController.Logon username, password

viewer.ReportSource = clientDoc.ReportSource
'viewer.EnableLogonPrompt = false



Dim BooleanSearchControl
Set BooleanSearchControl = objectFactory.CreateObject(&quot;CrystalReports.BooleanSearchControl&quot;)
BooleanSearchControl.ReportDocument = clientDoc
viewer.BooleanSearchControl = BooleanSearchControl
viewer.ProcessHttpRequest Request, Response, Null
' ReportClientDocument will be automatically closed when clientDoc is released
%>
 
Ok, could you explain me also how to pass two parameters to my report? Is that also in this file?

I'm not sure where to code them and wich crystal object to use to refer to each of them.

Do you have a similar example?

 
This file will let RAS prompt you for the Parameters. If your not wanting to be prompted, amend the Record Selection formula in the report itself so that it's fixed.
 
Yes I understand that, but in that case, I will have the same report everytime...

What I want to do, it's to pass the parameters trough the URL or a Get method or something, then my asp to take this parameters and send them to the report...

Look at this code:

'************************************************************
'*** Work with the reports parameter ***
'************************************************************

'This line creates an object to represent the collection of parameter fields that are contained in the report.

Set Session(&quot;ParamCollection&quot;) = Session(&quot;oClientDoc&quot;).DataDefinition.ParameterFields

'Create a reference to the parameter value to be set

Set session(&quot;ParamToChange&quot;) = session(&quot;ParamCollection&quot;).Item(0)

'This line creates a temporary variable to store the value to pass to the paraemter field.
' In this case it’s defined as a discrete value.

Set session(&quot;NewValue&quot;) = objFactory.CreateObject(&quot;CrystalReports.ParameterFieldDiscreteValue&quot;)
session(&quot;NewValue&quot;).Value = CStr(Request.Form(&quot;ReportTitle&quot;))

'The following lines of code creates the Parameter Field object.
'From the Parameter collection which will be changing the value for

Set session(&quot;TempParam&quot;) = objFactory.CreateObject(&quot;CrystalReports.ParameterField&quot;)
session(&quot;ParamToChange&quot;).CopyTo session(&quot;TempParam&quot;)

'This line sets the new current value for the Parameter.

session(&quot;TempParam&quot;).CurrentValues.Add(session(&quot;NewValue&quot;))

'The ParameterFieldController is used to add, remove, and modify parameter fields in a report.

Set session(&quot;ParamController&quot;) = Session(&quot;oClientDoc&quot;).DataDefController.ParameterFieldController

session(&quot;ParamController&quot;).Modify session(&quot;ParamToChange&quot;), session(&quot;TempParam&quot;)

It takes the ReportTitle and send to the report.. how can I adapt this code to work in the asp that you gave me?
 
I am having the opposite problem. We have set up e-portfolio lite with a default username and password so the user doesn't need to enter one. However, we are now looking for a way to add "security" to e-portfolio lite. Does anyone have any input or ideas how to do this? We thought of setting up groups in SQL and assigning users to those groups and having them log onto the database each time they want to run a report. the problem we are getting is whenever we enter a user name and password, it just flashes back to the log on screen and says enter username and password. We have also thought of trying to tie it back to NT to authenticate users. We are just getting started on this project so any input is welcome. We are on Crystal version 9 and using e-portfolio lite on Windows 2000 server. Thanks in advance, Rob
 
RobbieB -

You probably want to open a new thread for your request...you'll get more responses.

I know that at least one 3rd party company makes a security add-on for Enterprise Lite (v.10) - but can't seem to find their name. I'll look for it...

Also, since this is a new project - you may want to consider at least upgrading to Crystal 10 as a part of this. Business Objects XI (aka "BOXI") is being released soon - probably in time for the BO Partner Conference in February.

Crystal 9 will be retired soon, and it was a pretty buggy tool to begin with....

MJRBIM

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top