Results 1 to 2 of 2

Thread: VB6 Crystal 8.5 Save report Changes Programatically

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    2

    Question 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"

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VB6 Crystal 8.5 Save report Changes Programatically

    Try objReport.Close before you set it to nothing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width