Results 1 to 10 of 10

Thread: Crystal report do not refresh

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    5

    Crystal report do not refresh

    Hi, I am new in vb as well as crystal report. I am using crystal report 10 in vb6. When I call crystal report using CRAXDRT in vbfirst time data comes automatically but next time when i click the refresh button then only the new data comes, where ever I am using dicardsavedata as well as refresh. My code are as


    Public Sub doopen1(rptname As String)

    Dim crxapplication As New CRAXDRT.Application
    Dim crxreport As New CRAXDRT.Report


    Dim strx As String
    CrView.EnablePrintButton = True

    strx = App.Path

    If Right(strx, 1) <> "\" Then
    strx = strx & "\"

    End If
    strx = strx & "report\" & rptname


    Set crxreport = crxapplication.OpenReport(strx)
    CrView.EnableRefreshButton = True
    CrView.ReportSource = crxreport
    CrView.Refresh
    CrView.ViewReport

    CrView.Zoom 100
    Me.Show 1
    crxreport.DiscardSavedData
    ' CrView.RefreshEx (True)
    CrView.Refresh

    End Sub
    where as my crystal report is bounded with an Access table.that is altered no problem with that.

    Pls help

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Crystal report do not refresh

    Welcome to the Forums.

    I'm not familiar with version 10 but shouldnt you be setting your DataSource property too.


    Moved
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    5

    Re: Crystal report do not refresh

    Thanks, what do you mean I could not understand. I search but there is no any datasource property in Crystal report Active X viewer. Can you explain little bit more. Still I have same problem unless and untill I do not click refresh button it doesn't refresh. Waiting from your side.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Crystal report do not refresh

    Well I dont have 10, only 8.5 so its probably different. But where are you setting your connection source (datasource) property? It would be the source of data for your report object - crxreport
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    5

    Re: Crystal report do not refresh

    Thanks, my crxreport(craxdrt report) is taking data from an .rpt file and that .rpt file is directly taking data from an access table. here if I will directly see the rpt file that is ok and alteresd every time but the altered report is not coming to crystal report active x viewer I.E. on the vb form.
    Last edited by Khalique; Aug 14th, 2006 at 12:42 AM. Reason: mistakes

  6. #6
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: Crystal report do not refresh

    In your .rpt file, make sure that the option to Save Data with Report is NOT checked.
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Crystal report do not refresh

    If it is checked or not, having the call to .DiscardSavedData right after your opening of the report should do it.

    crxreport.DiscardSavedData
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    5

    Re: Crystal report do not refresh

    Thanks, Save Data With Report Is Already Unchecked From Both The Option In File Menu. I Did Discardsave Data Also At The Appropriate Position. Actually What Happens When I First Open Report Through Vb Then It Works But When I Close It And Reopen The Report Through Vb Without Rerun The Project Then Untill I Didn't Press Refresh Button It Dosen't Refresh.

  9. #9
    Member jeruelx5d's Avatar
    Join Date
    Jun 2006
    Posts
    39

    Re: Crystal report do not refresh

    If you have a recordset that loads data into your access database, before calling your .rpt file make sure to close the recordset declaration.

    Are you using temporary database for your crystal report? if not just do it, and make your temporary database connected to crystal...

    Everytime you call a report, kill the existing temporary database and replace it with new blank temporary database (of course you have to make tables but no record) then load data from recordset that you want to be displayed. Close the recordset declaration and connections string, then you can now call your .rpt file (.rpt file is connected to temporary database.)

  10. #10

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    5

    Re: Crystal report do not refresh

    Thanks, still I am facing same problem. I did close the recordset. I don't know how to assign a record set to a rpt file from vb where as I need some particular colums and some specific records from MASTERTABLE. I can't use RDC.

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