469,315 Members | 1,503 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

How to change logon information in crystal reports at runtime

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[i].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
Jul 21 '05 #1
1 8184
Hi Munish,

You might want to look at the microsoft.public.vb.crystal newsgroup. This
question has been answered many times there. Brian Bischof also has an
online book that explains it really well at
http://www.crystalreportsbook.com/Ch...GN=NGCR_031503

David Straker

"munish" <mu**************@hotmail.com> wrote in message
news:07****************************@phx.gbl...
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[i].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

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Stephan | last post: by
2 posts views Thread by Karun Karunakaran | last post: by
3 posts views Thread by Milan Todorovic | last post: by
reply views Thread by Ben | last post: by
19 posts views Thread by Michael O'Donnell | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.