Link to home
Start Free TrialLog in
Avatar of apss
apss

asked on

Problem using crystal report with Visual Foxpro Tables.

Hi,

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.
Avatar of Mike McCracken
Mike McCracken

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:

CrystalReportsSample
http://fox.wikis.com/wc.dll?Wiki~CrystalReportsSample~VFP

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)
http://www.hentzenwerke.com/catalogpricelists/crysdeve.htm

CrysDev: A Developer's Guide to Integrating Crystal Reports (Printed copy)
http://www.hentzenwerke.com/catalogpricelists/crysdev.htm

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

www.ml-consult.demon.co.uk
www.craigberntson.com


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.

http://support.businessobjects.com/communityCS/FilesAndUpdates/scr8_vfp_rdc_param_value.exe.asp

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.

http://support.businessobjects.com/communityCS/FilesAndUpdates/scr8_vfp_rdc_export.exe.asp

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.

http://support.businessobjects.com/communityCS/FilesAndUpdates/scr8_vfp_rdc_preview.exe.asp


Additionally and for added information, please visit this site:

http://www.tek-tips.com - after you register (for FREE), go to the Visual FoxPro area and post your crystal reports questions. If you are familiar with Universal Thread (http://www.universalthread.com/), 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 site...so please try.


Goodluck,
jrmn
Avatar of apss

ASKER

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.

apss
Avatar of apss

ASKER

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.

Thanks
apss
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.

http://support.businessobjects.com/communityCS/FilesAndUpdates/SCR8_VB_RDC_DBPassword.exe.asp

mlmcc
Avatar of apss

ASKER

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.
apss
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial