engnouna
Jul 7th, 2006, 02:10 AM
Hi
I am using VB6,crystal report 9 and SQL server 2000,I have a command button that displays the report inside crystal report viewer,but every time i need to display a report,the crystal viewer displays to me the last report so i need to press on refresh to view the current report.
I tried in my VB6 code the following code to make the refresh automatic but it didn't work
Rs.Open str2, cnn, adOpenStatic, adLockOptimistic
Set oApp = New CRAXDRT.Application
Set oReport = oApp.OpenReport(App.Path & "\Report2.rpt", 1)
oReport.Database.SetDataSource Rs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
crvMyCRViewer.Refresh
Rs.Close
where should I place crvMyCRViewer.Refresh?
thanks
I am using VB6,crystal report 9 and SQL server 2000,I have a command button that displays the report inside crystal report viewer,but every time i need to display a report,the crystal viewer displays to me the last report so i need to press on refresh to view the current report.
I tried in my VB6 code the following code to make the refresh automatic but it didn't work
Rs.Open str2, cnn, adOpenStatic, adLockOptimistic
Set oApp = New CRAXDRT.Application
Set oReport = oApp.OpenReport(App.Path & "\Report2.rpt", 1)
oReport.Database.SetDataSource Rs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
crvMyCRViewer.Refresh
Rs.Close
where should I place crvMyCRViewer.Refresh?
thanks