Results 1 to 9 of 9

Thread: Refreshing Crystal Rpt

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    Sunny Scottsdale Arizona
    Posts
    254

    Question Refreshing Crystal Rpt

    I use Crystal Rpt 8.0 via the Report Design Component in Visual Basic 6.

    I am using the following method for calling up my reports:

    VB Code:
    1. With frmRptView
    2.         .Show
    3.         .CRViewer1.ReportSource = rptPrimDls3
    4.         .CRViewer1.ViewReport
    5.     End With

    frmRptView is a form I use to call up all of my reports. The only thing on it is the CRViewer1 control.

    My problem is that the report is not refreshing accordingly. If the user makes a change to the underlying table, which the report is based on, and then goes into view the report the change will not be reflected. It is only after the user exits the application and returns that the change will appear in the report.

    Note: Doesn't seem to matter if I have the report set to 'Verify on Every Print' or not.

    Thnx
    Last edited by Jefftopia; Oct 23rd, 2003 at 09:02 AM.

  2. #2
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    Have you tried adding....

    VB Code:
    1. crviewer1.refresh

    if that does not work, try modifying the method you use to call your report. Usually, in all reports that "I" have encountered so far, you have this part (see 2 lines below) inside the form - frmRptView (Form_LOAD) itself. If you have it already, then try removing the 2 lines in your code.

    VB Code:
    1. .CRViewer1.ReportSource = rptPrimDls3
    2. .CRViewer1.ViewReport

    In my case, I usually just call the form and the report comes up.

    VB Code:
    1. frmRptView.Show 'YOU WILL BE LOADING THE FORM TO BE VIEWED ON THE SCREEN. ALL
    2. 'CRYSTAL RELATED EVENTS SHOULD BE PLACED
    3. 'OR INITIALIZED WITHIN THE FORM ITSELF.
    Last edited by ARPRINCE; Aug 27th, 2003 at 12:22 PM.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    Sunny Scottsdale Arizona
    Posts
    254

    Unhappy Refresh Method

    I tried adding CRViewer1.Refresh as suggested and received a Run-time error: Method 'Refresh' of object 'ICrystalReportViewer3' failed.

    Until I can figure something else out, I set EnableRefresh button property to True. Now my users will have to use this button to update their report. Why can't I do what this button in Crystal Reports is doing in vb?

  4. #4
    Hyperactive Member VB4fun's Avatar
    Join Date
    May 2003
    Location
    too far from Fiji
    Posts
    342
    not quite sure here...

    is this a typo ?

    object 'ICrystalReportViewer3'


    do you somehow have more than one object on the page? Because everywhere else I am seeing CrystalReportViewer1...
    Talk does not cook rice.
    -Chinese Proverb

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    ICrystalReportViewer3 is a Crystal COM object.

    These types of errors are usually caused by an invalid installation or corrupt registry. One or more of the crystal dlls may not have registered properly or could be the wrong version.

    I am suprised the Refresh button on the Viewer control works.

  6. #6
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    ...

    I get the same error when I try to refresh my Viewer programmatically

    Code:
    CRViewer1.Refresh
    so where is the solution for this issue?

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

    CR Refresh
    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
    Hyperactive Member tommygrayson's Avatar
    Join Date
    Aug 2005
    Location
    In my Nissan Silvia
    Posts
    433

    Thumbs up Re: Refreshing Crystal Rpt

    Quote Originally Posted by Jefftopia
    I use Crystal Rpt 8.0 via the Report Design Component in Visual Basic 6.

    I am using the following method for calling up my reports:

    VB Code:
    1. With frmRptView
    2.         .Show
    3.         .CRViewer1.ReportSource = rptPrimDls3
    4.         .CRViewer1.ViewReport
    5.     End With

    frmRptView is a form I use to call up all of my reports. The only thing on it is the CRViewer1 control.

    My problem is that the report is not refreshing accordingly. If the user makes a change to the underlying table, which the report is based on, and then goes into view the report the change will not be reflected. It is only after the user exits the application and returns that the change will appear in the report.

    Note: Doesn't seem to matter if I have the report set to 'Verify on Every Print' or not.

    Thnx


    Try using CRViewer1.RecordSelectionFormula on your parameter so that every time a user presses the refresh button the report will look to the valu in the recordselectionformula.
    Rate Me! Rate Me! Rate Me!

    Time to fly.

    Copyright GraysonSoft Inc. 2007

  9. #9
    New Member
    Join Date
    Nov 2005
    Posts
    4

    Re: Refreshing Crystal Rpt

    you can refresh your report by closing the odbc connection before calling this code.
    Quote Originally Posted by Jefftopia
    I use Crystal Rpt 8.0 via the Report Design Component in Visual Basic 6.

    I am using the following method for calling up my reports:

    VB Code:
    1. With frmRptView
    2.         .Show
    3.         .CRViewer1.ReportSource = rptPrimDls3
    4.         .CRViewer1.ViewReport
    5.     End With

    frmRptView is a form I use to call up all of my reports. The only thing on it is the CRViewer1 control.

    My problem is that the report is not refreshing accordingly. If the user makes a change to the underlying table, which the report is based on, and then goes into view the report the change will not be reflected. It is only after the user exits the application and returns that the change will appear in the report.

    Note: Doesn't seem to matter if I have the report set to 'Verify on Every Print' or not.

    Thnx

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