CrystalReportViewer

T

tg

My sincere apologies for the crosspost. I posted in one other ng. I am not
sure which is the correct ng for this question.I'm using .NET 2003. This is
the first time I've tried to use Crystal
within .NET. I'm connecting to an Oracle database. I'm using
System.Data.OracleClient, dll v1.1.4322. I can connect to the server
with no problem through the report. I place a Windows
CrystalReportViewer on a form, but when I run the form, I cannot
connect to the server. I am presented with a dialog box asking for
server name, user name, etc., but it gives me a dialog box stating it
cannot log on to server, after I enter the credentials.

I have the connection string set in the OracleConnection, and the
ReportSource is set on the CrystalReportViewer.

Can someone please offer help?

Many thanks
tjguillo
 
B

Bernie Yaeger

Hi tjguillo,

Go to the report's database menu, set database location, properties. You
need to define the login elements inside the report, or you need to do it in
a report document object.

HTH,

Bernie Yaeger
 
R

Richard

Dim oRpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
oRpt.Load("c:\reportname.rpt")

Dim logonInfo As New CrystalDecisions.Shared.TableLogOnInfo()
Dim table As Table

' Set the logon information for each table.
For Each table In oRpt.Database.Tables
' Get the TableLogOnInfo object.
logonInfo = table.LogOnInfo
' Set the server or ODBC data source name, database name,
' user ID, and password.
logonInfo.ConnectionInfo.ServerName = "servername"
logonInfo.ConnectionInfo.DatabaseName = "databasename"
logonInfo.ConnectionInfo.UserID = "userid"
logonInfo.ConnectionInfo.Password = "password"
' Apply the connection information to the table.
table.ApplyLogOnInfo(logonInfo)
Next table

CrystalReportViewer1.ReportSource = oRpt

GK
 
T

tg

Thanks Richard. Fits the bill...

Richard said:
Dim oRpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
oRpt.Load("c:\reportname.rpt")

Dim logonInfo As New CrystalDecisions.Shared.TableLogOnInfo()
Dim table As Table

' Set the logon information for each table.
For Each table In oRpt.Database.Tables
' Get the TableLogOnInfo object.
logonInfo = table.LogOnInfo
' Set the server or ODBC data source name, database name,
' user ID, and password.
logonInfo.ConnectionInfo.ServerName = "servername"
logonInfo.ConnectionInfo.DatabaseName = "databasename"
logonInfo.ConnectionInfo.UserID = "userid"
logonInfo.ConnectionInfo.Password = "password"
' Apply the connection information to the table.
table.ApplyLogOnInfo(logonInfo)
Next table

CrystalReportViewer1.ReportSource = oRpt

GK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top