Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Report 9 and Visual Basic 6.0 SP5

Status
Not open for further replies.

Maximus37

Technical User
Dec 7, 2002
21
0
0
US
I have received great help from this website, I maybe I can also help someone with the following.

When working with the RDC (Report Desinger Component) of on a and the same report is used several times or in several cases; the first report will work just great, but the next will be blank; what is needed before displaying the report are 3 simple lines of code, assuming you have declared your variables and/or pointing to the proper CrystalReport# to use:

Set CrystalReport# = Nothing
CrystalReport#.ReportSelectionFormula=""

then againg passing the formula you will use with the report:

CrystalReport#.RecordSelectionFormula="YourFormula"

I hope this helps someone having some kind of trouble displaying reports.

Max35
 
Mine is still showing up blank until I hit the refresh button. I've looked everywhere for a solution. If I put a pause after the DB update and before showing the report it works but the pause has to be 3-4 seconds, which is way too long.
 
and by the way I also use .DiscardSavedData prior to displaying the report.
 
I don't know how valid this is, but with my little bit of VB knowledge, wouldn't a DoEvents work here?
Juan
Scotland (currently)
 
Nope, tried that. It seems that the DB Update just prior to loading the report isn't done, even though I just closed it and set the recordset to Nothing. I even put a call to query the data and populate a datagrid just prior to calling the report and no problem populating the grid but the report is still blank until I hit the refresh. I may even have to hit the refresh 2-3 times.
 
DrJavaJoe, send the code you have to display that report, If I find something there I'll gladly help.

Max35
 
This is called immediately after an update function which inserts the record to be viewed in the viewer.

crShowerDoorCutsheets.DiscardSavedData
crShowerDoorCutsheets.Database.Tables(1).Location = ACCESSFILENAME
DoEvents
crShowerDoorCutsheets.DiscardSavedData
crShowerDoorCutsheets.RecordSelectionFormula = "{tblmfghdr.MfgHdrID} = " & gdblMfgHdrID
DoEvents
CRViewer1.ReportSource = crShowerDoorCutsheets
DoEvents
CRViewer1.ViewReport
 
Try this, it's sort of a refresh, it works with mine just fine:


Set crShowerDoorCutsheets=Nothing
crShowerDoorCutsheets.RecordSelectionFormula=""
crShowerDoorCutsheets.Database.Tables(1).Location = ACCESSFILENAME
crShowerDoorCutsheets.RecordSelectionFormula = "{tblmfghdr.MfgHdrID} = " & gdblMfgHdrID
CRViewer1.ReportSource = crShowerDoorCutsheets
CRViewer1.ViewReport

Hope it solves your problem.
Max35

 
Sorry forgot to mention that I did try that to no avail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top