An in-depth look at how to integrate Crystal Reports with Visual FoxPro applications.

This course is aimed at VFP developers who want to use Crystal Reports as their main reporting tool. It will show you how to create a wide range of reports based on Foxpro data and how to integrate the reports into your VFP applications.

What you will achieve

At the end of the course, delegates who meet the pre-requisites will be able to write VFP program code to manage and control Crystal Reports from within their applications. You will be able open, print, preview and export reports under program control, and give your users many options for modifying the appearance and behavior of the reports at run time.


To benefit from the course, you should be an experienced Visual FoxPro programmer with a good understanding of its OOP features. Experience of ActiveX Automation would be useful but is not essential. You do not need any previous knowledge of Crystal Reports.

Course Contents

Getting started with Crystal Reports

  • Creating reports in the CR design surface; using CR experts.
  • Adding more sophisticated features: grouping, sorting, aggregation, conditional formatting, record selection, special fields, run-time parameters.
  • Programming reports with the Crystal Formula Language.


Although the course will give you a useful start in designing reports, it does not aim to cover CR's report design or other end-user features in detail. The main focus is on programming and application development.

Using VFP as a data source

  • Creating reports based on VFP free tables.
  • Using ODBC to connect to VFP databases.
  • Changing file locations at run time.
  • Dealing with changes in table structures.

Distributing reports to non-CR users

  • Exporting report data.
  • Compiling reports to free-standing executables.
  • Using alternative report viewers.
  • Integrating reports with a web browser.

Integrating reports in VFP applications

  • Using the Report Design Component to control reports programmatically.
  • Creating a custom preview window with the Report Viewer control.
  • Dealing with Report Viewer events.
  • Changing the data source at run time.
  • Refreshing data programmatically; working with run-time parameters.
  • Creating a generic report selector form.
  • Letting the user customize the content, layout and formatting of reports.
  • Controlling grouping, sorting and record selection at run time.
  • Printing and exporting reports under program control.
  • Distributing CR components with your VFP applications.


This part of the course concentrates on the Report Design Component and Report Viewer control. We do not cover the older integration methods, such as the Report Engine API or the Crystal OCX.


The course requires Crystal Reports version 8.5 or 9 Developers Edition (parts of the course are also applicable to version 7.0 Professional Edition). The course is equally suitable for programmers working with Visual FoxPro 9.0, 8.0 and 7.0.