views:

179

answers:

1

Using VB6 AND Crystal Report 9

In my software when i view my report, it is displaying a old data's, if there is any changes in the data's every time i have to refresh my report. How to refresh the report automatically when i run my software.

Code

Dim crApp As CRAXDRT.Application
Dim Report As CRAXDRT.Report
Set crApp = New CRAXDRT.Application
Set Report = crApp.OpenReport(App.Path & "\ScheduleReport.rpt")
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
CRViewer1.EnableExportButton = True
CRViewer1.DisplayGroupTree = False
CRViewer1.EnableSearchControl = False
CRViewer1.Zoom (100)

I tried CRViewer1.refresh, It showing error

How to refresh the report in my code itself.

Need VB6 code Help

+3  A: 

Try discarding the saved data before setting the viewers report source

Report.DiscardSavedData
CRViewer1.ReportSource = Report
Anand
you can also edit the report and un-select the "Save data with report" option under the file menu.
dotjoe