473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

CrystalReport and ODBC configuration

Hi,

I've created an ODBC connection with SQL Server 2000, for conneting to
MyDatabase.
In the process of building that ODBC connection, I test the connection and
fine with no problem.
However, in my C#.Net project, I add a CrystalReport MyReport to my project,
then I test running MyReport, it will pop out a small box asking me to key
in DataBase, Username and Password again.
What do I need to do to let MyReport running without keying those data?
Thanks for help.
Jason
Nov 17 '05 #1
1 2143
You need to apply logon info to the report before showing it. Here I am
getting the logon info from config file.
Check this code for doing the same. Hope its helpful

Database crDataBase;
Tables crTables;
TableLogOnInfo crTableLogOnInfo;
ConnectionInfo reportConnectionInfo = new ConnectionInfo();
reportConnectionInfo.ServerName =
ConfigurationSettings.AppSettings.Get("serverName" );
reportConnectionInfo.DatabaseName =
ConfigurationSettings.AppSettings.Get("DatabaseNam e");
reportConnectionInfo.UserID =
ConfigurationSettings.AppSettings.Get("UserID");
reportConnectionInfo.Password =
ConfigurationSettings.AppSettings.Get("Password");
//Dummyprint is the CR report file.
Dummyprint dummyrep = new Dummyprint();
DataBase crDataBase = dummyrep.Database;
crTables = crDataBase.Tables;
foreach (Table crTable in crTables) {

crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = reportConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);

}
Regards,
Sanjeevakumar Hiremath.
Proteans Software Solutions

"Jason Huang" <Ja************@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Hi,

I've created an ODBC connection with SQL Server 2000, for conneting to
MyDatabase.
In the process of building that ODBC connection, I test the connection and
fine with no problem.
However, in my C#.Net project, I add a CrystalReport MyReport to my
project,
then I test running MyReport, it will pop out a small box asking me to key
in DataBase, Username and Password again.
What do I need to do to let MyReport running without keying those data?
Thanks for help.
Jason

Nov 17 '05 #2

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

Similar topics

11
by: DJJ | last post by:
I am using the MySQL ODBC 3.51 driver to link three relatively small MySQL tables to a Microsoft Access 2003 database. I am finding that the data from the MySQL tables takes a hell of a long time...
8
by: Philip Wright | last post by:
I am trying to connect to a DB2 v7.2 database from Lotus 123 v9.8 on a Windows XP Pro machine. I have the Software Development Client installed on the XP machine and have run the Client...
2
by: serge | last post by:
Do I have to use the DB2 Configuration Assistant in order to create an ODBC System DSN? I had a windows computer with no IBM DB2 installed. I downloaded the IBM DB2 client i think which after...
9
by: mcbill20 | last post by:
Hello all. I just installed Oracle 10g developer tools on a machine running XP Pro and Office XP. Before this I had just the Oracle 9 client installed. I the previous configuration, I was able to...
1
by: Jason Huang | last post by:
Hi, Would someone tell me how to open a CrystalReport in my ASP.Net C#? We can use the Show method to open a windows form, but what method should we use for opening a CrystalReport? Thanks for...
0
by: gilles.carali | last post by:
Bonjour, J'ai deux serveurs Domino Notes (A et B) en cluster qui se connectent à l' AS400 via DB2 ou ODBC. Configuration : Win2000, Domino Notes V5.013a Client Access Express en V4.5 (SP...
9
by: Jacques Lebastard | last post by:
I have a problem writing PHP ODBC scripts that suit both MySQL and PostgreSQL. So far, the following syntaxes seem to apply to each database (this is an 'insert' example; the same differences apply...
2
by: Dale Sampson | last post by:
My app uses an ODBC connection for a .mdb file. I want the app to create the source if it does not already exist (I copy a blank .mdb file to the users data store if it doesn't exist). I see how...
0
by: agcabutotan | last post by:
Hi to everyone. I am new in this thread, please help me. I'm having difficulty with CrystalReport.Net. I have a completed project written and compiled in VB.Net (and I used CrystalReport.Net in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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,...
0
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...
0
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...
0
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...
0
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...

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.