Hi Michal,
This is the code I'm using, it works great IF it the datasource is a SQL
server, as we speek( or as I write
) I'm been unable to get the thing
going on a dataset, but it works great on a SQL backend. The thing is that
you have to set the db info using code, when you do that you are ok.
Here is the code basically what you do is set the logon info on all the
tables of the report
Hope this help,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
ConnectionInfo crConnectionInfo = new ConnectionInfo();
crConnectionInfo.ServerName = "127.0.0.1";
crConnectionInfo.DatabaseName = "CTP";
crConnectionInfo.UserID = "test";
crConnectionInfo.Password = "test";
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;