Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass recordset to crystal report in VB program?

Status
Not open for further replies.

LAYZ

MIS
Nov 8, 2001
8
US
Hi,
I am relatively new to VB and Crystal reports.
Please, help me with some working sample or reference book I can read to
retrieve data into adodb recordset and pass it to the pre-formatted Crystal report.

Thanks
 
There are some examples on Crystal's web site, but they aren't very clear.

There are some third party reference books that cover this, including my own. You can also try the "Complete Reference" by Peck. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Create the report:

1. Create an SQL command against your database and test it outside of Crystal to make sure you are getting what you want for results.
2. Create a new Crystal Report.
3. For your data source, choose "Other Data Sources", then choose ADO.
4. Crystal will ask you to connect to the database.
5. Paste your SQL into the window provided.

Create the VB code:

1. Create an ADO recordset in VB and open it (use the same SQL with regard to fields and tables)
2. Use the following command to use the recordset created in #1 for the report (assuming your report is Report1, and your ADO recordset is adoRS):

Report1.Database.SetDataSource adoRS,3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top