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

Refresh crystal reports report when printed from visal basic

Status
Not open for further replies.

DEWELN

MIS
Nov 28, 2002
7
0
0
SG
I want to print a report generated with Crystal Reports from a visual basic application. I do this with the command "Report1.PrintReport". The report is shown but still contains the data from the last save of the report. The system does not refresh the data . How can I force it ?
We use Microsoft Visual Basic 6.0 and Crystal Reports 8.5.

I have already tried to de-select the reporting option "Save data with report". Then, the visual basic program does not show the report and does not give any error message.

Can someone give me advise ?

 
When in Crystal....go to File....the Report Options and uncheck the checkbox that says 'Save Data With Report'. That should do the trick...I have also seen people pass a parameter to the report to get it to refresh...but that was in older versions of cystal.
 
I solved my problem by using the code :

With CrystalReport 'the control
.ReportFileName = "groups.rpt"
'connection to a data source ie SQL Server
.Connect = myConnectionObject
.Action = 1 'print the report
End With

Thanks for your help anyway !

Nicole
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top