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!

Passing Recordset to a Crystal Sub-report from VB6 at Runtime

Status
Not open for further replies.

Shakhawat

MIS
Jul 25, 2002
2
BD
In my project, I have to change record source at run time. I can do this in case of single report in the following way:

dim Report as CrystalReport1
dim rs as new adodb.recordset

Set Report=New CrystalReport1
rs.open "SQL statement...."
Report.Database.SetDataSource=rs
CRViewer1.ReportSource = Report
CRViewer1.ViewReport

But problem is arising when I am trying to change record source of a report which contained another 'Sub Report'. I could not find any method to assigning record source to a sub report in run time.

I would be grateful if any body help me on the above.
 
found this in the crystal reports developers guide

set CRXSubreport = CRXReport.OpenSubreport("sub1")
set CRXSParamDefs = CRXSubreport.ParameterFields

page 82-83 in the cr dev guide.
 
Once you set the subreport you can pass it recordsets using the same syntax as the main 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