[RESOLVED] Crystal Report Printing
I had develop a program using VB6 with Crystal Report 8.5 as reporting tools. When I run this piece of code on end-user's platform, I will get error when printing the report. The message appears to be 'Cannot open SQL Server'. But when I open the report designer, and I go to 'Database->Verify Database', then it works, it requires the connection to ODBC. Is there a way to by pass this step? Avoid the pop up error message?
Pls advise.
Thanks.
Re: Crystal Report Printing
I use this bit of code to run reports. It does the db stuff..
VB Code:
Set Report = crxApplication.OpenReport("Z:\DAD\LotJobDiff.rpt", 1)
For Each crxDatabaseTable In Report.Database.Tables
crxDatabaseTable.ConnectionProperties("user id") = "sa"
crxDatabaseTable.ConnectionProperties("Password") = myPasswordTechniSQL
Next crxDatabaseTable
Report.SelectPrinter glbPrinterDriver, glbPrinterName, glbPrinterPort
Report.PaperOrientation = crDefaultPaperOrientation
If glbPrinterDestination = 0 Then
glbReportForm = "frmPSOutOfSynch"
CRViewer.Show vbModal
Else
Report.PrintOut False
End If
Re: Crystal Report Printing
Hi,
I guess whatever connection string you are using in your data entry forms just use that connection string for your crystal reports connection. I guess it should work. :)
Re: Crystal Report Printing
Hi Pasvorto
Could you pls post the full code for the process??
I dont quite get your ideas...
Thanks
Re: Crystal Report Printing
You may also need .SetLogonInfo, but I have a couple of examples in my signature for CR. ;)