|
-
Nov 15th, 2006, 11:19 AM
#1
Thread Starter
Hyperactive Member
[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.
-
Nov 16th, 2006, 11:19 AM
#2
Re: Return empty report in Crystal Report
Read the cr tutorial at my signature for cr in the Vb.
-
Nov 16th, 2006, 12:30 PM
#3
Thread Starter
Hyperactive Member
Re: Return empty report in Crystal Report
Those codes in the link you suggested are not suitable for VB6.
Thnak you.
-
Nov 16th, 2006, 02:21 PM
#4
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:
Dim sngTime as Single
sngTime = Timer + 3
Do
Loop Until Timer>sngTime
-
Nov 16th, 2006, 02:26 PM
#5
Thread Starter
Hyperactive Member
Re: Return empty report in Crystal Report
 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:
Dim sngTime as Single
sngTime = Timer + 3
Do
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|