Results 1 to 4 of 4

Thread: VB 6 & Crystal Reports 7 - Report not refreshing on printing

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    8
    In the program writing, I am passing a selection formula to a Crystal Reports 7 (using the Crystal Reports OCX) report. This selection is based on information gathered and stored in an Access97 working table. The old data is cleared from the table prior to each call for the report. The problem I am having is that after displaying/printing the report the first time, repeated calls to display the report do not refresh the data. I included the refresh button on the report display so that the user can refresh the report manually. This seems to be a particular trait of Crystal Reports 7, as I did not have that problem with Versions 5 & 6. Is there a way to have the report refreshed automatically each time it is called? Below is the code I have on my Print button.

    strDateTime = Str(Now)
    FillWorkTable strDateTime

    With frmMain.CrystalReport1
    .DataFiles(0) = gdbLocation & C_DBNAME
    .ReportFileName = App.Path & "\Reports\rptShortListQueryBy.rpt"
    .SelectionFormula = "{wtblPersonal.UserID} = " & glngUserID & " AND {wtblPersonal.DateTime} = " & QuoteSingle(strDateTime)
    .Formulas(0) = "QueryBy= " & Quote(gstrQueryBy)
    .WindowShowExportBtn = False
    .WindowShowRefreshBtn = True
    .WindowShowSearchBtn = False
    .Destination = crptToWindow
    .WindowState = crptMaximized
    End With
    If frmMain.CrystalReport1.PrintReport <> 0 Then
    gstrProcedure = "Crystal Report Error - " & frmMain.CrystalReport1.LastErrorNumber & " - " & frmMain.CrystalReport1.LastErrorString
    LogErrors gstrProcedure
    MsgBox gstrProcedure
    End If

    Any help that you may provide to solve this problem will be greatly appreciated.

    Tommy


  2. #2
    Lively Member Dr_Evil's Avatar
    Join Date
    Mar 2000
    Location
    Columbus, OH
    Posts
    105
    Uncheck the "Save data with report" option in the Crystal Reports file menu.
    Dr_Evil
    Senior Programmer
    VS6 EE
    VS.NET EA

  3. #3
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Help

    Dont want to seem rood Taz but I am having major problems with VB5 Pro and the version of Crystal Reports Ive put a post in the database section please could you have a look and help if possible


    Thanks Spud

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    8
    Originally posted by Dr_Evil
    Uncheck the "Save data with report" option in the Crystal Reports file menu.
    That was done. From what I gathered, the problem is that crystal reports caches the data for a report and won't update it unless the user clicks the update button on the crystal tool bar.

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