VB6 Crystal 8.5 Save report Changes Programatically
Hi all,
I having a problem editing a report and saving the information back to the report programatically.
Basically, I have a report with a parameter that contains Default Vaules.
I open the report in VB and want to ADD a few default values and then save the report.
Everything works EXCEPT for the SAVE. I ALWAYS get a message that the file is in use by another application when trying to save.
Even if I just try and open a report... and not modify it AT ALL, then try and save it...I get ( "The file is in use by another application." )
Here's some REALLY stripped down BASIC code.
---------------------------------
Code:
Dim oApp As CRAXDRT.Application
Dim objReport As Report
Dim m_strReportView as string
m_strReportView = "c:\Temp\MyTest.rpt"
Set oApp = New CRAXDRT.Application
Set objReport = oApp.OpenReport(m_strReportView)
objReport.Save m_strReportView
I've also tried coping the report to a new report object and closing the original... with the no luck
Code:
Dim objSaveReport As Report
Set objSaveReport = objReport
Set objReport = Nothing
DoEvents
objSaveReport.Save m_strReport
Does Anyone know what I'm doing wrong?
BTW... Saving the report as a different report DOES work.
Code:
objReport.Save "c:\Temp\MyTest2.rpt"
Re: VB6 Crystal 8.5 Save report Changes Programatically
Try objReport.Close before you set it to nothing.