Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Disconnect from CR and still PrintPreview??

Status
Not open for further replies.

JoseC

Programmer
Dec 11, 2001
18
0
0
Environment: VB6, SQL 7.0, CR6.0 OCX

Using the following, I can get the report to PrintPreview okay. But it keeps the connection open.
This VB app is a Print Engine, I pass data to it and it displays in PrintPreview to user.

1. How do I close the connection without terminating this VB app?

'-------------------------- CODE ------------------------
with CrystalReports
.ReportFileName = reportparameters("reportfilename")
.SQLQuery = reportparameters("sqlquery")
.Connect = "Provider=SQLOLEDB;SERVER=" & MSSQL_DB & ";DATABASE=MyDB; UID=myUID; PWD=myPWD"
.Destination = crptToWindow
.WindowShowZoomCtl = True
.WindowShowRefreshBtn = False
.WindowShowNavigationCtls = True
.WindowState = crptMaximized
.WindowTitle = "Print Preview: " & reportparameters("reportname")
.printreport
end with
Do
lWindowID = FindWindow(vbNullString, "Print Preview: " & reportparameters("reportname"))
If lWindowID = 0 Then: Exit Do 'if window has been closed/terminated then exit this Do..Loop, then exit sub.
DoEvents
Loop
'-------------------------- CODE ------------------------

Thanks!
 
Asking again. :)
I have searched the Seagate support area and come up with mixed answers. Still no solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top