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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a Recordset in Crystal Reports

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I am getting the data in a recordset after using ActiveX components and I want to use the recordset for displaying the data in Crystal Reports using VB. Can any body help me?
Thanks in advance.
 
For this purpose Use RDC
The Crystal Reports, Report Design Component(RDC) is an in-process ActiveX DLL based on the Component Object Model (COM). Crystal Reports RDC satisfies all of your dynamic reporting needs.
Technical Support reference to the RDC examples contained in the downloadable file ASPXMPS85.exe that you will found on Crystal Decision web site

First create your report on DAta source Active Data(Field definition)or (.ttx)

then write these code in VB

'Creating an Application Object
Set CRPapp = CreateObject("Crystal.CRPE.Application")
'Create Report object
Set CRPreport = CRPapp.OpenReport("ReportNameWithPAth.rpt")
'Create Report database object
Set crpDatabase = CRPreport.Database
'Create report database table collections object
Set crpDatabaseTables = crpDatabase.Tables
'Create table object
Set crpDatabaseTable = crpDatabaseTables.Item(1)
'Create your Recordset in VB like rs
'Assign your recordset rs to table object
crpDatabaseTable.SetPrivateData 3, rs
'Set report selection formula"
CRPreport.RecordSelectionFormula = "Your select formula if any"
'Sort your report on any field
CRPreport.RecordSortFields.Add Asc/dec, fieldName
CRPreport.ReadRecords
'to display report on screen
CRPreport.Preview Title, Left, Top, Width, Height, style, parentwindow


For more detail read Crrdc.hlp file that you find in your machine at this location c:\Frogram File\Seagate Software\Report Designer Component\crrdc.hlp
 
Recordsets can be tricky, but you can use them with any integraion method, not just the RDC.

First, make sure the report can accept a recordset. This means creating it using the Active Data Driver.

Second, use a command like SetPrivateDate to pass the recordset to the report. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top