Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Report Client Fail Logon

Posted on 2010-08-25
10
Medium Priority
?
429 Views
Last Modified: 2013-12-17
Good Morning/Afternoon/Evening

I have this issue (once again) with Crystal Reports. I have tried multiple ways to solve it, but still no answers.

Here's some information
1. I log on a SQL database on my server, into which I can have access from any client computer.
2. All the information used are correct
3. I'm using SQL Authentication

Here's the problem I encounter
1. I can't log on my client computer for CReporting, unlike the local working computer where it's working.
2. When the logon window prompt, the Database Name Field is always emptied

I tried the SetDataBaseLogon() function (with both overloads)
I tried the ApplyLogOnInfo() function

I don't know to do else :S
0
Comment
Question by:Lefarfadais
  • 5
  • 4
10 Comments
 
LVL 11

Expert Comment

by:tickett
ID: 33529235
Hi Lefarfadais, could you re-word your question- it's rather hard to understand.

Maybe paste the code you're currently using too. If you're "applylogoninfo" you shouldn't get the prompt really...

L
0
 
LVL 3

Author Comment

by:Lefarfadais
ID: 33531137
@tickett

Sure

I have a window application that manage our products, however, now I need to print reports of it. I've added a Crystal Report Document in my project, but whichever steps I do, it doesn't seems to be working on the client computer.

The constant error I get is "Logon Failed". When I try it locally (on my developpement computer) it's working, it doesn't show the prompt and show me the proper report and all. When I open it on the client computer, the prompt appear and inside of it, the field "Database Name" is always empty, whichever thing I tried.

My database is on my company server, so it's accessible on any computer here. It's a SQL Database and I built my Report with SQL Authentication access.

I've added the code where I do the ApplyLogOnInfo

I don't know what to do anymore. I've created a new Crystal Report Document with one field and I explicitly created is with SQL Authentication, but it still generates the failure.


ReportDocument monRapport = new Report.MainReport(); //My CR Object

ConnectionInfo info = new ConnectionInfo();

info.AllowCustomConnection = true;
info.UserID = "User";
info.Password = "Pass";
info.ServerName = "Server";
info.DatabaseName = "DB";
info.IntegratedSecurity = false;
info.Type = ConnectionInfoType.SQL;

TableLogOnInfo tbl = new TableLogOnInfo();

monRapport.SetDatabaseLogon("User", "Pass","Server", "DB");
//monRapport.SetDatabaseLogon("User", "Pass");
/*
foreach (Table t in monRapport.Database.Tables)
{
tbl = t.LogOnInfo;
tbl.ConnectionInfo = info;
t.ApplyLogOnInfo(tbl);

}/**/

this.crystalReportViewer1.ReportSource = monRapport;

Open in new window

0
 
LVL 16

Expert Comment

by:13598
ID: 33532182
Does your report have any subreports? If it does you need to set the logon for those as well.
 
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 3

Author Comment

by:Lefarfadais
ID: 33532191
@13598

Thank you for your answer, however there is no Sub Reports. All the information are in the main report.
0
 
LVL 16

Expert Comment

by:13598
ID: 33532551
If you go into SQL and look in the Security/Logins, do you see the username you are trying to use to connect to the db?
If you see it, right-click on it and select Properties. Is the database in question selected and does the user have public and db_datareader access roles to it?
0
 
LVL 3

Author Comment

by:Lefarfadais
ID: 33532582
@13598

Thank you for your answer. I've already double checked my Database, and the user appear on the Security/Logins, the login have the correct database selected and does have the db_datareader role. I even tried and put him to db_admin and still generate the failure.
0
 
LVL 16

Expert Comment

by:13598
ID: 33532647
The fact that the user log on prompt window does not even display the database could point to the fact that the issue is the connection. Maybe you could add some messageboxes to show what the values are for servername and databasename when the user runs the program.
0
 
LVL 3

Author Comment

by:Lefarfadais
ID: 33533001
@13598

Thank you for your answer. I've added the following code below just before I set the report in the ReportViewer. I get the right information out of it. However I still get the prompt window with the DataBaseName Field empty. On my dev computer, it's working alright, but not on the client.
MessageBox.Show(monRapport.DataSourceConnections[0].DatabaseName);
MessageBox.Show(monRapport.DataSourceConnections[0].ServerName);

Open in new window

0
 
LVL 16

Accepted Solution

by:
13598 earned 2000 total points
ID: 33533071
Do you perhaps have an ODBC driver on your dev PC and not on your client's?
Could you check your ODBC drivers to see?
0
 
LVL 3

Author Closing Comment

by:Lefarfadais
ID: 33533346
@13598

Thank you for your help.

I was completely unaware of the OBDC version on the client computer. I realized that there were no Native Sql Client so I worked around and used the OLE DB for SQL Server and now it's working.

Thank you again
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question