473,772 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing Server/Database in Crystal Report at runtime

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/l...s/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
Nov 16 '05 #1
2 7741
I use
protected void SetSecurityInfo (string server, UserNameAndPass word 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.Tabl es)
{
TableLogOnInfo tl = t.LogOnInfo;
tl.ConnectionIn fo = cn;
t.ApplyLogOnInf o(tl);
}
r.Refresh();
}

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

r is the report object.

"fatboy" wrote:
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/l...s/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

Nov 16 '05 #2
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.
"Bonj" <Bo**@discussio ns.microsoft.co m> wrote in message
news:35******** *************** ***********@mic rosoft.com...
I use
protected void SetSecurityInfo (string server, UserNameAndPass word 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.Tabl es)
{
TableLogOnInfo tl = t.LogOnInfo;
tl.ConnectionIn fo = cn;
t.ApplyLogOnInf o(tl);
}
r.Refresh();
}

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

r is the report object.

"fatboy" wrote:
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/l...s/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

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3026
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields for reporting purposes and am wondering if anyone knows if this is easily accomplished using the .NET version of Crystal Reports? For example, the description column may be reporting on a dataentry error as follows: TXNCODE: 1010001
7
4031
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at runtime, the report still showed the results from the default query (from within the Crystal Report). Then I tried the XSD solution where you define a dataset (that mataches the database and the Crystal Report) and have the Crystal Report use this....
0
1478
by: Das | last post by:
Hi everyone, I have been using crystal report with visual basic 6. I know with crystal report & sql server, if there is a different server name than the one you created report. It prompts as Unable to Logon server. I used to use the following code in vb6 which worked perfectly fine with vb6 to connect to any server. Dim tlb As CRAXDDRT.DatabaseTable
0
1180
by: Ahmed Hashish | last post by:
If I have a report connects to access database how could I change it to connect to sql server database at runtime from my asp.net application. Ahmed
5
4246
by: soulkitchen | last post by:
After I change a fairly complex stored procedure and I run a report against it, crystal hangs at "assesing database". I have verified the database. When I run a trace on SQL is shows repeated cachemiss over and over. I let it run for 30 minutes and nothing. Anyone?
0
2533
by: Crash | last post by:
Hello everyone, I need help creating an asp page to view a crystal report, which requires that that I change the database connection dynamically. I thought I had this problem licked in CR7 (the version of crystal the report has been designed in) but when I tried to deploy CR7 to my server I found that I could not install the ASP components on IIS 6.0 (even using the manual installation method). I had a CR9 dev edition update, which came...
0
1058
by: hemu4hemang | last post by:
Hi Friends I m working on one application in Vb.net and Sql server and crystal report 9.0. This application works fine and all reports are open successfully. I assign servername and database name at runtime in my code while opening reports. But whenever i change my server some reports are not open. If i open these reports manually from crystal report and update servername and database name...
1
2476
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi, I have bumped into this issue where my application (which consistently reads the database) has to also create a crsytal report when requested. The crystal repost uses the same connection string as the application (i parsed the connection string and set the ConnectionInfo) However, the crystal report fails to logon and gives an exception : Logon failed. Error in File Quote {E2D18712-BD5A-4EE7-867E-79F137EB549D}.rpt: Unable to connect:...
2
2187
by: hmznzr | last post by:
i am using b.net 2005. i am generating a crystal report. but when i work in a different computer i have to set the location of the database of the report before i generate. is their any dynamic way to set my database location to the report.
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.