Crystal Reports Problem: Please reply ASAP

M

Mithun Verma

Hello All,
I have a Windows application that uses Crystal Reports 9 (bundled Version)
developed using VS.NET 2003 on a windows server 2003 m/c.
The application has to be deployed on the client machine that has Windows
XP installed. Before deploying we make sure that .NET framework 1.1 is
installed on the XP machine. In the setup project, for support for Crystal
Reports, we have added the following merge modules:
1)Crystal_Managed2003.msm
2) Crystal_Database_Access2003.msm
3)Crystal_Database_Access2003_enu.msm
4)Crystal_RegWiz2003.msm
5)VC_User_CRT71_RTL_X86.msm
6)VC_User_STL71_RTL_X86.msm

The problem we are facing is like this: Whenever the user tries to pull up
the reports, a database logon screen pops up for the report. I am unable to
figure out as to why this is happening only for Crystal Reports. All the
other functionality in the application is working fine without having to
specify the database connection information interactively. The database
server is not in the same network as this Client WinXP machine. We specify
the IP address of the DB server in the DB connection string. Could this be a
problem?
If someone has faced this problem earlier or has any solution to this
problem, do let me know. I need to resolve this problem ASAP.

Thanks in advance
Mithun
 
N

Nauzad Kapadia

hi,

This is not a problem, but indeed the way crystal report works.

When you create a crystal report that connects to a database, it does not
persist the password in the report itself. Therefore everytime u run the
report and the report tries to fetch the data from the database and in the
process asks you for the password.

The work around for this is to supply the password and any other database
connection parameters to crystal reports at runtime, just before you show
the report. Refer to the following code-snippet

Dim cr As New CrystalReport1()

Dim crConnInfo As New ConnectionInfo()

Dim tInfo As New TableLogOnInfo

crConnInfo.DatabaseName = "pubs"

crConnInfo.UserID = "sa"

crConnInfo.Password = "sa"

tInfo.ConnectionInfo = crConnInfo

cr.Database.Tables(0).ApplyLogOnInfo(tInfo)

Make sure to repeat the last line for every table u use in the report or
loop thru tables.count property.



Regards,

Nauzad Kapadia [MVP]
 
R

Rishit Raj

Hello Nauzad,
Thanks for the reply. But I have a few doubts on that one too....
While asking for Username/Password may be the right behavior displayed
by Crystal Reports, but I do not want the client to be filling in the DB
Server credentials everytime he/she wishes to see the report. And
besides, I wouldnt be expecting the user to know the Server Credentials
for pulling the reports.

The other point related to my problem is: Even after the user provides
the credentials of the Database, it isnt allowing the reports to be
pulled. It provides a MessageBox saying: "Logon Failed". The server
details are exactly the same that have been provided in the connection
string.

The approach I have used for the reports is as follows:
1)Create a stored proc for the report.
2)In Server Explorer, generate a dataset from the SP.
3)The Dataset gives me just one table that has all the result.
4)Use this dataset to design the report and drag the fields on the
report.
5)Now, at runtime, execute the same Stored Proc, fill a dataset and
assign it to the Report.
6)Assign the report to the Viewer.

My reports have been working fine at our end and also when we tried to
run the application from our end with the DB connection string pointing
to the remote machine. Even then, the reports worked fine without any
requirements for Credentials being provided at run time.
I am just not sure what is being missed that causes this logon prompt.

Your suggestions will be greatly appreciated.

Regards.


I'll be there for you.............
 
G

Guest

When You Create Your Report... use trusted connections... to get around the problem. You'll need to add your clients as users.
 

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