Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Printing EXISTING Crystal Report login error Post Reply Post New Topic
Author Message
Rulex
Newbie
Newbie


Joined: 03 Mar 2009
Location: Canada
Online Status: Offline
Posts: 4
Quote Rulex Replybullet Topic: Printing EXISTING Crystal Report login error
    Posted: 03 Mar 2009 at 7:00am
Hello everybody, this forum is my last hope Cry  I couldn't get any answers from any C# forums.   Here is the problem.  I'm writing COM in C#.  This COM has to print/preview EXISTING !!!!! Crystal Report.   Repeat, I don't have to create reports, just show/print them.  Here is the code:
 

ReportClass myReport = new ReportClass();

myReport.FileName = “C:\…some path to the report file”;

myReport.SetDatabaseLogon(“userid”, “password”, “server”, “database”);

myReport.PrintOptions.PrinterName = “some printer”;

m_ myReport.PrintToPrinter(1, false, 0, 0);

 

Some problem appears in SetDatabaseLogon(...) function.  It returns error:

“Unable to connect: incorrect log on parameters”, which is absolutely wrong message, because all parameters are OK.  For debugging purpose I just hard coded “userid”, “password”, “server”, “database” while using SetDatabaseLogon function.  And without any problem  using these parameters I could login to Query Analizer or Management studio, also  I could open the report and create new connection using these “userid”, “password”, “server”…

 

Does anybody has any idea what am I missing?  What am I doing wrong?

Microsoft, Crystal Report guru, where are you?
 

Thank you in advance,

Rulex

IP IP Logged
Rulex
Newbie
Newbie


Joined: 03 Mar 2009
Location: Canada
Online Status: Offline
Posts: 4
Quote Rulex Replybullet Posted: 05 Mar 2009 at 11:40am

For those who might be interested I’ve solved this problem:

 

Instead of calling SetDatabaseLogon(...) (still don’t understand why this function didn’t work) I set logon info to all tables of the report and all tables of sub reports (if any)

 

Regards,

Alex

IP IP Logged
sidewinder
Newbie
Newbie


Joined: 09 Apr 2009
Location: United States
Online Status: Offline
Posts: 5
Quote sidewinder Replybullet Posted: 13 Apr 2009 at 8:57am
I'm having a similar experience, but with VB.NET 2005.  I used the same solution as you Alex, but due to the nature of the SQL database security setup and ODBC connectivity, I'm not able to get past the login hard coded into the application.  I'm pretty certain at this point, it's using the Userid and password for the workstation's user and not the one from the program. 
 
I'm curious to know if anyone else has experienced this problem and if so, how they were able to get around it?
TIA
 
Gary
IP IP Logged
Rulex
Newbie
Newbie


Joined: 03 Mar 2009
Location: Canada
Online Status: Offline
Posts: 4
Quote Rulex Replybullet Posted: 14 Apr 2009 at 7:25am
Hi Gary, maybe I didn't understand you correctly, but the description of your problem make me think, that your report was designed to use some ODBC data source to connect to database.  And this ODBC data source using Windows Authentication option rather than SQL Server Authentication.
 
Good luck,
Alex
IP IP Logged
sidewinder
Newbie
Newbie


Joined: 09 Apr 2009
Location: United States
Online Status: Offline
Posts: 5
Quote sidewinder Replybullet Posted: 14 Apr 2009 at 8:57am
Hi Alex,
  You are correct that my report is trying to use an ODBC datasource.  Since the database is secure, using Windows Authentication isn't what we were looking for from a secuity and confidentiality point of view. 
 
  However, when using a userid/password combination in the code of the report it is rejected.  Similarly, when I try to set up ODBC for the same login/password it rejects them as well.  The user is valid on the database, but for some reason the validation process is rejected. 
 
  The only other possibility is to give the users of this report access to the database on an as needed basis.  However, I am open to ideas and suggestions from anyone who might have a more intimate knowledge of an issue like this.
TIA
 
Gary 


Edited by sidewinder - 14 Apr 2009 at 9:00am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.