Results 1 to 6 of 6

Thread: [RESOLVED] how to refresh Report

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    15

    Resolved [RESOLVED] how to refresh Report

    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

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: how to refresh Report

    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)

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    15

    Re: how to refresh Report

    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,

  4. #4
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Red face Re: how to refresh Report

    There may be slight diff in coding due to version. Below code is for CR9
    paste in Declarations:
    Code:
    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Posts
    15

    Resolved Resolved: Re: how to refresh Report

    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

  6. #6
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Red face Re: [RESOLVED] how to refresh Report

    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)
    Code:
        
    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

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