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

Visual Basic 6, Crystal Reports 6 Problem

Status
Not open for further replies.

zivrap

Technical User
Aug 10, 2004
31
CA

Hello,

I have the following vb code which opens a pre made report..

''General Declarations

Dim crpApplication As CRPEAuto.Application
Dim crpReport As CRPEAuto.Report

Private Sub Command1_CLick()

Set crpApplication = CreateObject("crystal.crpe.application")


Set crpReport = crpApplication.OpenReport("C:\r1.rpt")

With crpReport.PrintWindowOptions

.HasRefreshButton = True
End With


crpReport.Preview

End Sub

The report opens fine and displays all the data it should. However, when the refresh button is pressed in the report viewer, all the data disappears. Any suggesstions to the problem would be much appreciated. I am using vb6 pro and cr 6 pro.
 
According to the CR definition '[the Refresh action] will reload and display the report displayed in the Report Viewer from its original source'. I believe the clearing occurs because there is no access to the original data source.

With distributed reports I always set the .HasRefreshButton = False because of this problem, I dont see any need for it.

What do you expect to happen when the refresh button is clicked?

Maybe these comments helps.
 

Hi SonOfEmidec110,

Here is why I believe I need the refresh button. I have a report which uses data from an access databse in the same directory. When I change the data in the database and reload the report from vb the changes are not reflected. This is why I put in the refresh button. When I view the report in CR and hit refresh it works, but when I open it through vb and hit refresh it doesnt.

I also tried unchecking the "Save data with report delimiter" in crystal reports, but this causes a "Cannot find SQL server error when I open it through vb". Thanks for the help. I'll keep trying :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top