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 Automation - VB Refresh Problem

Status
Not open for further replies.

hmohrmann

IS-IT--Management
Feb 6, 2001
18
0
0
US
I am using the following VBA code to automatically refresh my crystal reports:
Dim crpApplication As CRPEAuto.Application
Dim crpReport As CRPEAuto.Report
Set crpApplication = CreateObject("Crystal.CRPE.Application")
...
Set crpReport = crpApplication.OpenReport(strStartDirectory & "\" & Rs!ReportName)
crpReport.DiscardSavedData
crpReport.ExportOptions.DiskFileName = strEndDirectory & "\" & Rs!ReportName
crpReport.ExportOptions.DestinationType = crEDTDiskFile
crpReport.ExportOptions.FormatType crEFTCrystalReport
crEFTCrystalReportcrpReport.Export (False)

If I use the crystal version 7 engine the reports are in version 7, if I use the crystal version 8 engine then the reports are in version 8.

What I would like to do is use version 8 and refresh into version 7. This works when you refresh and save using crystal, but there does not seem to be a way to do this in programming.

Any ideas?

Harry

 
Do you mean use the V8 engine to create a V7 rpt? Or use th V8 engine to view a V7 RPT as it would be viewed by V7 engine?

How are you 'saving' in the application? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
We are trying to maintain all our reports in version 7.
Most of us are using version 8 and then saving in version 7.
This works fine.
I have to run the VBA routine on a machine that only has version 7 installed so that all the reports are maintained in version 7.
If I run the VBA routine on a machine that has version 8 installed it reads the version 7 report, refreshes the data, and then saves the refreshed report in version 8.
I would like to know how to tell it to save in version 7.

Harry
 
Does the VBA routine need to save the report? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
My reports are on a web site.
Currently there are about 60, expanding to 300.
Every morning at 4am my routine refreshes the data in the reports.
We do not allow the web viewer to refresh (saves a lot of time, and we do not have to allow them access to the supporting database).
The routine has to save the report with the new data.
You can do this by hand in crystal reports and it works fine, I have not been able to figure out how to do this with automation.
Automation seems to default to the current version with no option to save in a prior format.

Harry
 
Don't know if there is a setting for this. Can you just keep the originals somewhere else? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I currently have two(2) folders.
1. This folder has the original reports.
2. This folder has the reports with the refreshed data.
My routine opens each report in folder 1 and saves a new copy with the refreshed data into folder 2.
If it runs on a machine with version 7 only installed it works fine.
If it runs on a machine with version 8 it saves the report in version 8. This is what I am trying to get around.

Harry


 
I don't remember this option.
What command are you using to save the report? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
If you look at my original posting you will see my basic code. I am opening the report, discarding the data, and exporting a new copy in crystal report format to a new disk file.

Harry
 
crEFTCrystalReport

This is one of options in the developer help under the topic
"ExportOptions Object, REOL " 

The list there corresponds mostly with the dropdown in the CR export window. However in the Export window there are two options: Crystal Report and CR7. This list doesn't give a second option. If they have that option it is a secret. You might try tacking a 7 on the end and seeing what happens. Or you could try a numeric argument. The list goes up to 26, but you could try the next few numbers and see if they didn't make the help. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Been there, done that.
First thing I tried.
I have tried every number up to 255.

Harry

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top