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.