Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Report Client Fail Logon

Posted on 2010-08-25
10
Medium Priority
?
428 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

722 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