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 an ADO recordset to a report with sub-reports

Status
Not open for further replies.

AWehrstedt

Programmer
Jul 16, 2001
21
CA
In VB 6.0, I am passing an ADO recordset to a report to pull a report on the current recordset, which is working great.

However, when I add a sub-report to the report and then try to run it again I get the message "File Not Found". Is there a special way to pass a recordset to a report containing sub-reports?

Thanks,

Andrew
 
You are passing a RS to the main report, but not the subreport? How does the subreport connect to its data? ODBC? Which integration method are you using? Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Well the 2 subreports are supposed to link to the ID field of the main report (which gets populated in the first recordset). I assumed that it would use the ID field it is supposed to link with to build the subreports.

All of the reports are connecting to an Access database through an ODBC connection. I built the report in Report Designer in Visual Basic and told it to use the Active Driver (ODBC,ADO).

Do I need to pass the two subreports recordsets as well?

Thanks,

Andrew Wehrstedt
 
The subreports are either connected to the data or using ADO.

If you used Acitve data to connect the subreports as well, you have to pass filtered recordsets to them.

If the subreports were NOT created using the Active data driver, but went directly to the ODBC Connection, then you (usually) have to log them into their data source in the code and then you can use a link to the main report to control record selection. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Ken,

What do you mean by a filtered recordset? Can the sub report have a seperate RS?

I have a report using a select and building an ADO recordset in VB6. Can I build and pass a second and seperate ADO recordset to a sub report?
 
subreports are always a separate virtual table, even in standalone CR.

So, yes, you can pass a separate recordset to the subreport. I am pretty sure you would have to, since it can't take the data from 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