Click to See Complete Forum and Search --> : [RESOLVED] how to refresh Report
bright18
Feb 1st, 2008, 04:09 AM
Dear all,
I am using front end as VB6, sql server & Crystal report. in VB 6 im using "Cystal Report Control" Component. Can anybody help me in how to refresh the report.
for the report i m passing one query & saving into one temp table. & that data i m generating report. but it is showing the previous records only. also can u please tell what is diffrence between "Crystal Report Conntrol" & "Crystal Report viewer". which is better to use?
Regards
Bright 18
VBFnewcomer
Feb 1st, 2008, 06:02 AM
1.By default under the Report options (CR9) there is a check box named Save data with report uncheck it.
2.How are you populating the report, by a query or at design time
3.If at design time check if the data is properly coming in to the temp table (I believe it is view/query you are taking about)
bright18
Feb 1st, 2008, 07:42 AM
Hi,
Thanks for the reply. I m using Cystal Report 8, & the Data is coming properly in temp Table , only the thing is , the Report data is not refreshing as per new data in a table. I m also deleting old data from temp table (by using Query) & then entering new data by executing a Query. if i go in Design view & manually Press Refresh button then only it shows the right data.
But in Cystal Report Viewer component Refresh poperty is there but how to set the path? when i used Reportsource property then it is showing me the error? Pls. help...
Regards,
VBFnewcomer
Feb 2nd, 2008, 01:15 AM
There may be slight diff in coding due to version. Below code is for CR9
paste in Declarations:
Dim appln As New CRAXDDRT.Application
Dim Report As New CRAXDDRT.Report
Private Sub Form_Load()
Report.SQLQueryString = SQL
CRViewer91.Refresh
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
End Sub
Hope I helped you :afrog:
bright18
Feb 4th, 2008, 02:11 AM
Hello,
I got the Solution, it is just in Report Option there is a Checkbox option "Save data with Report" , you have to just UNCHECK that option.
I tried u r given solution, but the starting two declration shows me the error "USER DIFINED TYPE NOT DIFNED".
Thanks for helping me.
Regards
Bright18
VBFnewcomer
Feb 4th, 2008, 02:43 AM
I got the Solution, it is just in Report Option there is a Checkbox option "Save data with Report" , you have to just UNCHECK that option. I believe saying that in #2.
I tried u r given solution, but the starting two declration shows me the error "USER DIFINED TYPE NOT DIFNED". you may have to add ref to CRAXDDRT9.DLL (usually found in C:\Program Files\Common Files\Crystal Decisions\2.0\bin) in your case it might be CRAXDDRT8.DLL or CRAXDRT.DLL (not sure)
Dim appln As New CRAXDDRT.Application
Dim Report As New CRAXDDRT.Report
Private Sub Form_Load()
Dim SQL As String
Set Report = appln.OpenReport(App.Path & "yourReport.rpt")
Report.Database.Tables(1).Location = App.Path & "yourDb.mdb"
Report.SQLQueryString = SQL
CRViewer91.Refresh
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.