Results 1 to 4 of 4

Thread: refresh a crystal report

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    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:
    1. Rs.Open str2, cnn, adOpenStatic, adLockOptimistic
    2. Set oApp = New CRAXDRT.Application
    3.     Set oReport = oApp.OpenReport(App.Path & "\Report2.rpt", 1)
    4.     oReport.Database.SetDataSource Rs, 3, 1
    5.     crvMyCRViewer.ReportSource = oReport
    6.     crvMyCRViewer.ViewReport
    7.     crvMyCRViewer.Refresh
    8. Rs.Close

    where should I place crvMyCRViewer.Refresh?

    thanks

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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.

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: refresh a crystal report

    VB Code:
    1. CRViewer1.EnableRefreshButton = True

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: refresh a crystal report

    VB Code:
    1. Rs.Open str2, cnn, adOpenStatic, adLockOptimistic
    2. Set oApp = New CRAXDRT.Application
    3.     Set oReport = oApp.OpenReport(App.Path & "\Report2.rpt", 1)
    4.     oReport.Database.SetDataSource Rs, 3, 1
    5.    CRViewer1.EnableRefreshButton = True
    6.     crvMyCRViewer.ReportSource = oReport
    7.     crvMyCRViewer.ViewReport
    8.     crvMyCRViewer.Refresh
    9. 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
  •  



Click Here to Expand Forum to Full Width