|
-
Jul 7th, 2006, 02:10 AM
#1
Thread Starter
Fanatic Member
refresh a crystal report
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
VB Code:
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
-
Jul 7th, 2006, 08:05 AM
#2
Frenzied Member
Re: refresh a crystal report
in crystal make sure you aren't saving the data with the report... in CR 11 it is under the File menu.
-
Jul 18th, 2006, 04:55 AM
#3
Re: refresh a crystal report
VB Code:
CRViewer1.EnableRefreshButton = True
-
Jul 18th, 2006, 04:57 AM
#4
Re: refresh a crystal report
VB Code:
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
CRViewer1.EnableRefreshButton = True
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
crvMyCRViewer.Refresh
Rs.Close
now refresh the report
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
|