|
-
Dec 22nd, 2005, 07:18 AM
#1
Thread Starter
New Member
crystal reports9-vb6 real beginner
hi everyone. im gonna ask a simple question but its too complex for me to find a solution..i tried to fine some samples but i couldnt make them work. i have very little vb or crystal reports knowledge. i create a report with crystal reports 9 and using vb6 and i also add a crystal crviewer to the form and now just looking it :P i dont know how to call report,which connection string to use and how to display data.. i want to preview and print report. is there a simple sample code for real beginners? using vb6,cr9 and access97 database.
thanks for help and patience
-
Dec 23rd, 2005, 05:35 AM
#2
Thread Starter
New Member
it works finally
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim crystal As CRAXDRT.Application
Dim report As CRAXDRT.report
CRViewer.DisplayBorder = False
CRViewer.DisplayTabs = False
CRViewer.EnableDrillDown = False
CRViewer.EnableRefreshButton = False
Set conn = New ADODB.Connection
conn.CursorLocation = adUseClient
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source C:\MySoft\MyDB.mdb;"
conn.Open
Set crystal = New CRAXDRT.Application
Set report = crystal.OpenReport(App.Path & "\report1.rpt")
report.DiscardSavedData
report.Database.SetDataSource rs
CRViewer.ReportSource = report
CRViewer.ViewReport
Do While CRViewer.IsBusy
DoEvents
Loop
CRViewer.Zoom 100
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|