Ken’s Quick Reference to Crystal Reports in VB
(Updated for Crystal XI, but still covering the older versions)This guide is now a FREE Download
Don't waste time trying to
figure out how to launch and control your Crystal Reports from
Visual Basic. Depending on your version of Crystal, there may be 4
different sets of syntax, and the commands aren’t always well
documented. This is especially true when it comes to passing
recordsets to a report. These short documents, with simple code
examples, will give you a clear overview of your options. It
assumes that you already know how to create a VB application, and
how to use Crystal Reports. (Note that you must have the
Developer Edition of Crystal Reports to do any VB
integration.)Included is working source code for compiling your own very simple Crystal Reports Desktop Viewer. The viewer will let you select a report from any directory and run the report, without installing Crystal Reports!
The VB techniques explained include the three most popular ways to launch reports:
1) The simple OCX (free with VB 6).
2) The original Automation Server.
3) The most powerful Report Designer Component (RDC) used in versions 9, 10 and 11.
**If you are using VB.NET you should get my Quick Reference to Crystal in VB.NET
You will learn:
The minimum components and references required in your project.Also included:
The objects and minimum code needed to launch an existing report.
How to Connect to the server in your application before launching SQL based reports.
How to Export to the most common formats
How to pass Active Data from the application to the report.
How to control Subreport features within your reports
How to override and control the following settings in your report, using VB commands:
Selection Formula
Groups
Sorts
Formula Fields
Parameter prompts
Common problems and solutions for formulas, parametersActive Data (passing a recordset to a report) is one of the most confusing aspects of using Crystal Reports. I will explain the different ways to create a report that can use Active Data, and the syntax for passing the recordset to the report.
Web based and other resources for more detailed study
The zip file contains:
1) The Quick Reference material in PDF format.
2) 10 simple VB projects that illustrate the material (based on VB6 and Crystal Reports v8 / v9 Developer Editions).