Solved

Crystal Report Client Fail Logon

Posted on 2010-08-25
10
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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