Solved

Crystal Report Client Fail Logon

Posted on 2010-08-25
10
421 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now