Results 1 to 5 of 5

Thread: [RESOLVED] Return empty report in Crystal Report

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    313

    Resolved [RESOLVED] Return empty report in Crystal Report

    I am using vb6 , Access Db and Crystal Report 9.

    I use query in vb to select data I want and insert them to a table called 'Report' in 'sample.mdb'. In Crystal report design time, I connect to this table 'Report' to get fields.

    When I run the Vb, I get what I want if I execute the codes step by step, in which I mean use a break point to execute the codes. But if I run it in a normal way, the report displays as an empty one.

    Here is the code to run the report in Vb6:

    CrystalReport1.ReportFileName = App.Path & "\CustList.rpt"
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.DataFiles(0) = App.Path & "\sample.mdb"
    CrystalReport1.Action = 1


    Could any one tell me what is going on?

    Thanks a lot.

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Return empty report in Crystal Report

    Read the cr tutorial at my signature for cr in the Vb.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    313

    Re: Return empty report in Crystal Report

    Those codes in the link you suggested are not suitable for VB6.

    Thnak you.

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Return empty report in Crystal Report

    MS Access uses a "write cache", meaning there is a delay of a few seconds before data is actually written to the database.

    Add this code, which creates a 3 second delay, between the code that inserts the data and that runs the report.

    VB Code:
    1. Dim sngTime as Single
    2. sngTime = Timer + 3
    3. Do
    4. Loop Until Timer>sngTime

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    313

    Re: Return empty report in Crystal Report

    Quote Originally Posted by brucevde
    MS Access uses a "write cache", meaning there is a delay of a few seconds before data is actually written to the database.

    Add this code, which creates a 3 second delay, between the code that inserts the data and that runs the report.

    VB Code:
    1. Dim sngTime as Single
    2. sngTime = Timer + 3
    3. Do
    4. Loop Until Timer>sngTime
    Thank you Bruce, It worked. Actually I Used 'DoEvents' Before I tried your code. The 'DoEvents' didn't do the trick.

    Thanks again.

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