How to change logon information in crystal reports at runtime

M

munish

I am using pull model in crystal reports.For simplicity I
m using only one table in SQL Server. I have tried
following code to change my database:
ConnectionInfo ci = new ConnectionInfo();
ci.ServerName = Changed_SERVER_NAME;
ci.DatabaseName = Changed_DATABASE_NAME;
ci.UserID = Changed_DATABASE_USER_NAME;
ci.Password = Changed_DATABASE_PASSWORD;
TableLogOnInfo li = new TableLogOnInfo();
li.ConnectionInfo = ci;
li.TableName = ChangedTableNameButSameStructure;
MyRep.Database.Tables.ApplyLogOnInfo(li);
crViewer.ReportSource = MyRep;
But when i view the report using crystal report viewer
control it shows me records of that table to which it was
connected to, when the report was designed.

Can anyone provide me help on this issue? Or tell me any
other way to change logon information, database and tables
at run time(in pull model)?
Thanx
munish
 

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