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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help - Report Data does not refresh

Status
Not open for further replies.

samonsey

Programmer
Jan 29, 2001
19
US
I have a VB6 app and I am using the CRViewer. I have a report based on a TTX file to which I pass an ADO recordset at runtime using the following code

Code:
            Set crdDatabase = rptReport.Database
            Set crtTable = crdDatabase.Tables(1)
            crtTable.SetDataSource Rst, 3

When I view the report the first time, everything works fine, however when I close the form with the viewer on it, and try to view the report with different parameters, I get the same data in the report. I check the recordset right before I call the SetDataSource method, and it is fine, but the report has the data from the previous view.

Any ideas would be greatly appreciated.

Thanks,
Asa Asa Monsey
samonsey@houston.rr.com
Maxim Group Consultant
Visual Basic / SQL Server
 
Are you using the Active Data driver (p2smon.dll)?

Seagate has an article (id# = c2002268): SetDataSource Method Does Not Pass Data to Report

Or try using the SetPrivateData method instead of SetDataSource. I don't know if it's gonna make any difference, but it's worth a try. The syntax is:

crtTable.SetDataSource 3, Rst

Also, in your report, is the option File/Save Data with Report checked? If it is, uncheck it.

 
After reading many related but unhelpful threads, I finally found one that mentioned a call to
Code:
 rptReport.DiscardSavedData
I am guessing this is the programmatic equivalent to the
Code:
 File>Save Data with Report
option. Since I work exclusively with dsr files in the VB IDE, I was not able to find this menu option. This resolved the problem.

Thanks for your help.

FYI, I dont know if it is my connection or what, but I have not been able to execute a search on the Cyrstal Decisions website in the forums or the KB. They keep timing out. The tek-tips forums have been a very helpful alternative. Asa Monsey
samonsey@houston.rr.com
Maxim Group Consultant
Visual Basic / SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top