Problem using crystal report with Visual Foxpro Tables.


I have an application in VB which accesses data from a Visual Foxpro Table ( NAMES.DBF )  using Microsoft Remote Data Control (MSRDC). The application displays a list of names from which the user has to select one. Next I have a report created with crystal RDC which has the same foxpro table (NAMES.DBF) + a linked table (DETAILS.DBF) as data source . Both the Remote Data Control and the Report use DSN less ( connection string based ) ODBC connections. This report displays the details associated with the selected name. My problems are:

1) This arrangement works fine for the first 10 records in the NAMES.DBF table, but if I select
    the 11th name or any name with record position > 10 , the report goes blank and does not display
    the name or any associated details. Is it due to the two concurrent connections (MSRDC & Report)
    to the same table ?

2) When I click on the 'Print' button in CRViewer91 toolbar, It gives an error: " There is not enough
    memory for this operation "  although the 'Export' button works perfectly fine.

3) Since the application is to be distributed, the location of these tables may depend on end user.
    So , instead of hardcoding the data source location, I need it to be specified by the user at
    runtime and changes being automatically made to the data source properties of the MSRDC and
    Crystal Report . While I have found a way of doing so for the Remote Data Control, I dont know
    how to do this for crystal report.

Since I have no knowledge of Visual Foxpro and am a beginner in VB and Crystal Reports, I shall appreciate all your suggestions along with the solutions to my problems. Thanks.
Who is Participating?
Computer101Connect With a Mentor Commented:
PAQed, with points refunded (500)

E-E Admin
Hi apss,

To get you started, I thought I'd try to feed you some places to look on Crystal Reports and VFP.
As of this writing, CR don't have anything specific for Visual Foxpro.
Most training and documentation (as far as I know) is focused on platforms they are strongly supporting which sad to say, VFP is not one of these.

You may find the following of value:


Also, there is a fairly new book out on the topic if you want to get totally immersed.  You can order it online and download the e-book for immediate use, if you're really in a hurry.

CrysDev: A Developer's Guide to Integrating Crystal Reports (ebook only)

CrysDev: A Developer's Guide to Integrating Crystal Reports (Printed copy)

Below are Crystal Reports VFP implementation experts sites. Feel free to visit here to get additional information.

Businees Objects do have a few samples of using the RDC in Fox Pro, Please see some sample applications below :

1.This Microsoft Visual FoxPro 6 Application uses the Report Designer Component (RDC) to demonstrate passing a parameter value to a report at runtime. This sample application is for use with Crystal Reports 8 and higher.

2.This Microsoft Visual FoxPro 6 application uses the Report Designer Component (RDC) to demonstrate exporting a report at runtime (without previewing or an export dialog box). This sample application is for use with Crystal Reports 8 and higher.

3.This Microsoft Visual FoxPro 6 Application uses the Report Designer Component (RDC) to demonstrate previewing a report. This sample application is for use with Crystal Reports 8 and higher.

Additionally and for added information, please visit this site: - after you register (for FREE), go to the Visual FoxPro area and post your crystal reports questions. If you are familiar with Universal Thread (, which most VFP programmers believed to be the best source of VFP resources, most of the top experts here who are really good in crystal reports implementation with VFP are also experts on Tek-Tips. I'm sure one of these guys can help you out with you crystal-VFP question. I have a friend who is a VFP programmer and he strongly recommended this please try.

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

apssAuthor Commented:
Hi Folks,

Sorry for the delay and thanks a lot for all the help. I will get back to you soon after checking out all the links provided by you.  Thanks again.

apssAuthor Commented:
Hi ,

I have checked all the links provided by you people. All the examples provide help on using crystal reports with Visual Foxpro which uses an Access Database ( xtreme.mdb ) as data source. My problem is alltogether different. I need to use crystal reports with Visual Basic  which has Visual Foxpro Tables ( *.DBF ) as datasource. My project has nothing do with VFP programming except for the fact that the VFP tables have been used as data source. It is very easy to integrate crystal reports with MS Access databases since crystal reports seem to be tailor made just for access databases. Although I have managed to connect crystal reports with VFP tables and have successfuly displayed data from these tables, but all of my problems begin after this stage. It would be a great help if you could provide information relating to my project setup i.e.  :-

Visual Basic + Crystal Reports + Visual Foxpro Tables

In the meantime I will check on the VFP forum suggested by jrmn.

Look at this one.  I realize it is for an Access database but the principle is the same for a FoxPro database.  Crystal doesn't provide VB with Foxpro database examples.

apssAuthor Commented:
Hi guys,

Well I have tried the link posted by mlmcc but it does not seem to work. When I try to specify the table location, as mentioned in the example ( .Table(1).Location = path ) , it give an error "Missing DSN String". Since I am using a DSN less ODBC connection to the foxpro tables, crystal reports doesn't support change of table locations in a DSN less ODBC connection. Anyway, I have figured out the solution to my problems:

1) As for the first problem, it was due to the link between the two tables which I changed from an Inner Join to Left
    Outer Join and the problem was resolved.

2) The second problem was due to simultaneous connections to the same table by the Microsoft Remote Data Controls
    used in the application and by the ODBC connections used by crystal reports. This was resolved by creating a
    DataEnvironment in the project and connections for the application and crystal reports to the foxpro tables are
    through this DataEnvironment. Now there are no memory problems.

3) I just changed the table location in the connection string of DataEnvironment and it worked for both the application
    and crystal report. Earlier I had to do it separately for all the Remote Data Controls and for the crystal report.

Anyway, thanks a lot for your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.