471,317 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Display Crystal Report with database logon ingo


hi,

I'm trying to display a simple crystal report from within a web
application but I keep getting prompted to enter login details for the
database (oracle). Entering the correct information manually displays
the report perfectly but there must be a way of passing the login
details automatically?? How do I do it? There is currently no code
in the page - I simply added a Crystal Report Viewer and set the report
as required.

I'm using VS 2005 and I'd appreciate any comments or example code!

Thanks.

Feb 21 '06 #1
2 5336
Hi,

I use this code in a 2003 solution.

TableLogOnInfos crTableLogonInfos = new TableLogOnInfos();

ConnectionInfo crConnectionInfo = new ConnectionInfo();

crConnectionInfo.ServerName =
System.Configuration.ConfigurationSettings.AppSett ings["Server"];
crConnectionInfo.DatabaseName =
System.Configuration.ConfigurationSettings.AppSett ings["DataBase"] ;
crConnectionInfo.UserID =
System.Configuration.ConfigurationSettings.AppSett ings["User"] ;
crConnectionInfo.Password =
System.Configuration.ConfigurationSettings.AppSett ings["Password"] ;

foreach (CrystalDecisions.CrystalReports.Engine.Table table in
reportDocument1.Database.Tables)
{
TableLogOnInfo crTableLogonInfo = new TableLogOnInfo();
crTableLogonInfo.TableName = table.Name;
crTableLogonInfo.ConnectionInfo = crConnectionInfo;
crTableLogonInfos.Add( crTableLogonInfo);
table.ApplyLogOnInfo( crTableLogonInfo);

}
CrystalReportViewer1.LogOnInfo = crTableLogonInfos;

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

<de****@360computing.net> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...

hi,

I'm trying to display a simple crystal report from within a web
application but I keep getting prompted to enter login details for the
database (oracle). Entering the correct information manually displays
the report perfectly but there must be a way of passing the login
details automatically?? How do I do it? There is currently no code
in the page - I simply added a Crystal Report Viewer and set the report
as required.

I'm using VS 2005 and I'd appreciate any comments or example code!

Thanks.

Feb 21 '06 #2
Hi,

You can pass in the connection details through the
ReportDocument.SetDatabaseLogon() method:

http://msdn.microsoft.com/library/de...ethodtopic.asp

Regards - Octavio
<de****@360computing.net> escribió en el mensaje
news:11*********************@g47g2000cwa.googlegro ups.com...

hi,

I'm trying to display a simple crystal report from within a web
application but I keep getting prompted to enter login details for the
database (oracle). Entering the correct information manually displays
the report perfectly but there must be a way of passing the login
details automatically?? How do I do it? There is currently no code
in the page - I simply added a Crystal Report Viewer and set the report
as required.

I'm using VS 2005 and I'd appreciate any comments or example code!

Thanks.

Feb 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mustufa Baig | last post: by
1 post views Thread by abc | last post: by
8 posts views Thread by rzaleski | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.