?
Solved

Invalid directory

Posted on 2011-10-05
8
Medium Priority
?
1,230 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:busugrilla
  • 4
  • 3
8 Comments
 
LVL 14

Expert Comment

by:VBClassicGuy
ID: 36916678
Win7 is very picky about where you place files. What is the full path to the exported file?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36917021
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
 

Author Comment

by:busugrilla
ID: 36923152
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 101

Expert Comment

by:mlmcc
ID: 36924262
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
 

Accepted Solution

by:
busugrilla earned 0 total points
ID: 36940712
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
 

Author Closing Comment

by:busugrilla
ID: 36967134
By simply using a higher version of Crystal Reports the report export problem was solved.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36942417
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
 

Author Comment

by:busugrilla
ID: 36946876
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question