3
Answers

Printing Crystal Report

Alex

Alex

16y
5.8k
1

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)
0
Ronal Parmar
NA 22 1.8k 12y

Dear,

        Please try below link to find the solution for your problem its really useful for you.

         http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.print(v=vs.71).aspx