473,573 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connecting Crystal Reports to DB2

C# .NET 2.0 - Crystal Reports XI

I am trying to connect Crystal Report to DB2 database from my C#
application. After I run the connection info code and try to export the
report I get

{"Database logon failed."} System.Exceptio n
{CrystalDecisio ns.CrystalRepor ts.Engine.LogOn Exception}
I am using the following code to connect:

Database crDatabase;
Tables crTables;
TableLogOnInfo crTableLogOnInf o;
ReportDocument crSubreportDocu ment;
Sections crSections;
SubreportObject crSubreportObje ct;
ReportObjects crReportObjects ;

ConnectionInfo crConnectioninf o = new ConnectionInfo( );

crConnectioninf o.ServerName = "DNS=MyDB2Serve r"; // or this
crConnectioninf o.ServerName = "MyDB2Serve r";
crConnectioninf o.UserID = "TestUser";
crConnectioninf o.Password = "TestPasswo rd";
crConnectioninf o.DatabaseName = "MyDB2Database" ;

//set up the database and tables objects to refer to the current report
crDatabase = cr.Database;
crTables = crDatabase.Tabl es;

//loop through all the tables and pass in the connection info
foreach (Table crTable in crTables)
{
crTableLogOnInf o = crTable.LogOnIn fo;
crTableLogOnInf o.ConnectionInf o = crConnectioninf o;

crTable.ApplyLo gOnInfo(crTable LogOnInfo);
}
I can connect with no problem when I am using CrystalReports IDE or when I
test my ODBC connection.

Does anyone know what values / format I have to specify to crConnectioninf o
or how to connect Crystal Report to DB2 from C# application?
Thank You
Peter
Feb 15 '06 #1
2 4472
Hi Peter,

Have you tried using the ReportDocument. SetDatabaseLogo n() method?

Regards - Octavio
"Peter" <pc*****@nospam .nospam> escribió en el mensaje
news:%2******** *******@TK2MSFT NGP11.phx.gbl.. .
C# .NET 2.0 - Crystal Reports XI

I am trying to connect Crystal Report to DB2 database from my C#
application. After I run the connection info code and try to export the
report I get

{"Database logon failed."} System.Exceptio n
{CrystalDecisio ns.CrystalRepor ts.Engine.LogOn Exception}
I am using the following code to connect:

Database crDatabase;
Tables crTables;
TableLogOnInfo crTableLogOnInf o;
ReportDocument crSubreportDocu ment;
Sections crSections;
SubreportObject crSubreportObje ct;
ReportObjects crReportObjects ;

ConnectionInfo crConnectioninf o = new ConnectionInfo( );

crConnectioninf o.ServerName = "DNS=MyDB2Serve r"; // or this
crConnectioninf o.ServerName = "MyDB2Serve r";
crConnectioninf o.UserID = "TestUser";
crConnectioninf o.Password = "TestPasswo rd";
crConnectioninf o.DatabaseName = "MyDB2Database" ;

//set up the database and tables objects to refer to the current report
crDatabase = cr.Database;
crTables = crDatabase.Tabl es;

//loop through all the tables and pass in the connection info
foreach (Table crTable in crTables)
{
crTableLogOnInf o = crTable.LogOnIn fo;
crTableLogOnInf o.ConnectionInf o = crConnectioninf o;

crTable.ApplyLo gOnInfo(crTable LogOnInfo);
}
I can connect with no problem when I am using CrystalReports IDE or when I
test my ODBC connection.

Does anyone know what values / format I have to specify to
crConnectioninf o or how to connect Crystal Report to DB2 from C#
application?
Thank You
Peter

Feb 15 '06 #2
Hi Peter,

Thanks for posting!

For the current issue, I'm sorry that Microsoft only supports the setup
issue of the Crystal Report, other supports will be provide by Crystal
Decisions. The KB article shows more details as below:
http://support.microsoft.com/default...b;EN-US;317789

In addition, I find an article from Crystal Decisions demonstrates how to
connect the database at runtime in VB.NET:
http://support.businessobjects.com/l...s/c2010371.asp

I hope this will be helpful. I appreciate your understanding!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Feb 15 '06 #3

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

Similar topics

3
6902
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
7
4992
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version,...
3
8911
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data from sql server) and I was wondering whish of these is the better tool .. We're still not sure if they'll be loaded from an existing VB6 application...
0
2132
by: Swaroop Bhattacharyya | last post by:
I want to access IBM DB2 CLP from Crystal Reports.This is for schedueling a job in Crystal Reports. How will i link the Crystal Reports and the IBM DB2 CLP ?
1
1607
by: mahesh123 | last post by:
Hi Folks, I am using the crystal reports 8.0 with VB6.0 and database is MSAccess. When i am connecting to the database through DAO, then i am getting an error DAO.Workspace Not a Valid Password. These error will occur at design time when we are adding the database in the crystal reports. How can we connect the database through DAO in...
2
19481
by: rathnaravi | last post by:
I am using NetBeans 5.0.I tried to connect MySQL with Crystal Reports XI.When writing the coding in Java Application.I get the following error. com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Unexpected error determining relative path---- Error code:-2147217395 Error code name:serverProgrammingError Could anyone help me to solve...
7
4402
by: Mohammed Seidu | last post by:
Hi all, Can anyone help me on how to create crystal reports in a .net windows application? The problem is, i have an OleDbConnection object named 'conn' which I create dynamically to connect to an access database and i want to use this connection to create crystal reports. I would welcome any help or alternative. Thank you all in advance.
3
3803
by: Miro | last post by:
Hi, Just wondering what a good book is on visual studios 2008 ( or 2005 if no 2008 ) that teaches you how to properly use crystal reports with it. Or im assuming that as long as I can create a dataset and link it to a reportviewer than any Crystal Report book will do. I use vb.net but im assuming most books would show you vb and c
1
8125
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings file and itself into the exe. You would probably want a tool for this bit which could be in the zip too. So the app isnt single exe when running but...
0
8031
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8204
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...
1
7795
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5600
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5294
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3734
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...
1
2223
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
1
1309
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1044
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...

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.