Solved

Crystal Report Client Fail Logon

Posted on 2010-08-25
10
423 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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 500 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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