Changing Server/Database in Crystal Report at runtime

F

fatboy

I'm trying to change the database and server on a report that was created
using integrated security e.g. report was created pointing to the server
'testserver' and database 'testdb' and at runtime i want to change the
report to connect to 'liveserver' & 'livedb'.

I'm using visual studio 2003, Crystal 10 Developer full (sp1) and c#
connecting to a sql server 2000 db using OLEDB connection and integrated
security.

I've tried the solution as per crystal support article
http://support.businessobjects.com/library/kbase/articles/c2011464.asp

but as i'm not supplying a username and password this gives a sql error
28000 when applying the logoninfo. I've tried setting the password and
username as various combinations of null and empty string to no avail.

if any one can help i would be most grateful

regards

barney
 
G

Guest

I use
protected void SetSecurityInfo(string server, UserNameAndPassword login)
{
ConnectionInfo cn = new ConnectionInfo();
cn.ServerName = server;
cn.DatabaseName = Consts.DBName;
cn.UserID = login.UserName;
cn.Password = login.PassWord;

foreach(Table t in r.Database.Tables)
{
TableLogOnInfo tl = t.LogOnInfo;
tl.ConnectionInfo = cn;
t.ApplyLogOnInfo(tl);
}
r.Refresh();
}

which works fine...
(UserNameAndPassword is a struct containing string UserName and string
Password.)

r is the report object.
 
F

fatboy

I'm afraid this doesn't work as the reports were created using integrated
security and are being run using an integrated security connection.

This mean the user doesn't log into the application and no user name /
password is manually supplied.

I've have even tried supplying my details and the sql server dbm details but
neither work.
 

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