Invalid directory

I am trying to develop VB6 SP6 application using Crystal reports 8 on a Windows 7 32-bit host OS.
When I try to export a report I keep getting Invalid Directory error from Crystal and the export fails.
Can any body help ?  Thanks
busugrillaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VBClassicGuyCommented:
Win7 is very picky about where you place files. What is the full path to the exported file?
0
mlmccCommented:
How are you exporting?
Through code or a viewer?

Can you view a report?

Is this a client application or server based?

Do you have permissions to the temp directories?

Where are you trying to put the report?

How do you pick the directory?
Navigate to it?

What code are you using to view/export the report?

mlmcc
0
busugrillaAuthor Commented:
Reply to VBClassicGuy:
path is D:\SOL Trial\crleavetotals1.xls

Reply to mlmcc:
I am exporting both through code and through viewer.
When from code xls file is created but empty.
When from viewer the windows Save As dialog box hangs up.
Yes I can view the report successfully.
It is a Client app.
What are the temp directories please ?
path is D:\SOL Trial\crleavetotals1.xls
From windows Save As dialog box.
First time yes I navigate to directory, then on subsequent attempts correct directory is displayed in the Save As dialog.
Please see code attached.
Public Sub ProcessReport8(pConn As Connection, pstrStoredProc As String, pReport As String, pReportName As String, Optional pOrientation As Integer = crPortrait, Optional pPaperSize As Integer = crPaperA4)

    Dim rst As New adodb.Recordset
    Dim CRXApplication As New CRAXDRT.Application
    Dim CRXReport As New CRAXDRT.Report
    
    'On Error Resume Next
    rst.Open pstrStoredProc, pConn, adOpenKeyset
    
    Set CRXReport = CRXApplication.OpenReport(pReport, 1)
    
    CRXReport.Database.SetDataSource rst
    CRXReport.PaperOrientation = pOrientation
    CRXReport.PaperSize = pPaperSize
    CRXReport.Database.Verify
   
   
    frmReportViewer.Caption = pReportName
    frmReportViewer.CRViewer1.DisplayGroupTree = False
    frmReportViewer.CRViewer1.ReportSource = CRXReport
    frmReportViewer.CRViewer1.ViewReport
    frmReportViewer.Show vbModal
    Set frmReportViewer = Nothing
    
    Set CRXApplication = Nothing
    Set CRXReport = Nothing
    
End Sub

Public Sub ExportReport8(pConn As Connection, pstrStoredProc As String, pReport As String, pReportName As String)
    
    Dim rst As New adodb.Recordset
    Dim CRXApplication As New CRAXDRT.Application
    Dim CRXReport As New CRAXDRT.Report
        
    rst.Open pstrStoredProc, pConn, adOpenKeyset
    
    Set CRXReport = CRXApplication.OpenReport(pReport, 1)
    
    CRXReport.Database.SetDataSource rst
    CRXReport.Database.Verify
    CRXReport.Export True
   
    Set CRXApplication = Nothing
    Set CRXReport = Nothing
   
End Sub

Open in new window

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mlmccCommented:
Try using a directory without the SPACE in the name.  CR8 was written for Win95 and I recall there were initially issues with directoy and file names with spaces.

mlmcc
0
busugrillaAuthor Commented:
I have solved the problem by installing and using Crystal Reports 9.22, instead of version 8.
CR 9.22 works well with VB6 and the export worked without a hitch.

Thanks alot for your help.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
busugrillaAuthor Commented:
By simply using a higher version of Crystal Reports the report export problem was solved.
0
mlmccCommented:
Did you try exporting toa directory with no spaces in the name?

I recall having tht as an issue when we used CR7 and 8.

mlmcc
0
busugrillaAuthor Commented:
To mlmcc:

Yes I tried as you suggested, with no spaces in the directory and file names but still no joy.

Thanks alot for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.