-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Jai
Message 9 in Discussion
Hi,
Just
have a look at the following code. It sets the connection and the
logon
information for the target database at runtime. The important lines are
in red.
private void SetLogOnInformation( ReportDocument
objReportDocument )
{
// Set the logon info
ConnectionInfo objConnectionInfo = new ConnectionInfo();
// Get the Server and Database information
from the connection
// Set the
connection information in the ConnectionInfo object
// Here objCon is
the object which contains your connection information
objConnectionInfo.ServerName = (string)objCon["SERVER"];
objConnectionInfo.DatabaseName = (string)objCon["DATABASE"];
objConnectionInfo.UserID = (string)objCon["USER ID"];
objConnectionInfo.Password = (string)objCon["PWD"];
foreach( Table
objTableNew in
objReportDocument.Database.Tables)
{
TableLogOnInfo objTableLogOnInfo = new
TableLogOnInfo();
objTableLogOnInfo = objTableNew.LogOnInfo;
objTableLogOnInfo.ConnectionInfo = objConnectionInfo;
objTableNew.ApplyLogOnInfo( objTableLogOnInfo );
objTableNew.Location = objConnectionInfo.DatabaseName +
"."
+
objConnectionInfo.UserID
+ "." +
objTableNew.Location.Substring( objTableNew.Location.LastIndexOf( "." ) + 1
);
}
}
Hope this
helps.
Regards,
Jai
-----Original Message-----
From: BDOTNET
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 09, 2003
9:54 AM
To: BDOTNET
Subject: Re: To crystal Report gurus
in asp.Net
New Message on BDOTNET
To
crystal Report gurus in asp.Net
Reply
Recommend
Message 8 in
Discussion
From: ARUNUDAYA
Hi Balaji
,
i have
around 50 reports, we i give to client i cant ask them to open
all report and set new database location path, so i need
alternate solution.
Arun
-----Original
Message-----
From: BalajiKrishnan
[mailto:[EMAIL PROTECTED]
Sent: Tuesday,
October 07, 2003 10:49 AM
To:
BDOTNET
Subject: Re: To crystal Report gurus in
asp.Net
New Message on BDOTNET
To crystal Report
gurus in asp.Net
Reply
Reply to Sender
Recommend
Message 6 in
Discussion
From:
BalajiKrishnan
Hi Arun,
I too face this problem....
So before executing the code,open the
Reports and run the report........(Press
F5)
It will ask for the Server name and
Database name,once you give the
Server name and the DB Name the location
will set......
Then execute the code you will not face any
problem....
try this....
Balaji.K
View other groups in this category.
View other groups in this
category.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]