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!

'Save Data with Report' from VB

Status
Not open for further replies.

trezlub

Programmer
May 2, 2003
67
GB
I am running Crystal Reports 8.5 from VB 6. I need to be able to open a report (which I can do no problem) and then be able to save that report (with data) and store it within a Folder on the local hard drive somewhere. Does anyone know how this can be done from VB?

Cheers


P.S. I have already posted this on the Crystal Forum with no luck
 
Try selecting the option in the report under FILE to Save Data With Report.

Then, in you VB code, use this CR parameter:

DiscardSavedData = False
 
Cheers CCLINT. I will try that in a bit. I was beginning to think no one could help me with this one
 
I can't get 'DiscardSavedData = False' to work. Always fails with error:

"Expected Function or Variable"
 
I have figured this out now, cheers for your help CCLINT.
 
I encounter the same problem, can I know how you solve it????

A lot of thanks.
Iris
 
In the report file inself, i.e. the .rpt file, choose the option to 'Save Data With Report'. When you save the rpt file make sure that this option is chosen but also that no data is currently saved with it. Then from VB code simply save the report and the data will be saved with the report. Eg VB code:

CrysRep.SaveAs <pathname>, cr80FileFormat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top