3
Reply

Printing Crystal Report

Alex

Alex

Feb 26 2009 2:25 PM
5.8k

Hello everybody,

 

I need to print existing Crystal Report from my application.  What I have:

 

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?

 

Thank you in advance,

Alex


Answers (3)