I am new to using Crystal Reports with VB.
I am trying to call a crytsl reports reports from a vb program any ideas will help.
Thanks in advance.Here's one example. You create a recordset in VB. You need to have "Crystal Report Engine 8 Object Library" in order for this to work. This example is based off Crystal Reports 8.5, so you'll have to adjust it to your needs for version 10.
Dim CrApp1 As New CRPEAuto.Application
Dim CrRep As CRPEAuto.Report
Dim CrDB As CRPEAuto.Database
Dim CrTables As CRPEAuto.DatabaseTables
Dim CrTable As CRPEAuto.DatabaseTable
'open report
Set CrRep = CrApp1.OpenReport(strReportPath)
'set the database object to the reports database
Set CrDB = CrRep.Database
'Set the databasetables object
Set CrTables = CrDB.Tables
'set the databasetable object to the first table in the report
Set CrTable = CrTables(1)
'sets ADO recordset as the data for the first table
CrTable.SetPrivateData 3, rsData
'preview the report with the recordset as the data
CrRep.Preview
You can also use Report Designer Component (RDC). It's set up similar, but I just started playing around with it and can't get it to work yet. Do a search on Crystal's website. They have PLENTY of code examples for RDC.
http://support.businessobjects.com/search/advsearch.asp
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment