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

Pass Dataset to CR10 Subreport

Status
Not open for further replies.

Paulus

Programmer
Sep 25, 2000
16
0
0
A1
I'm using Crystal Reports 10 Developer Edition with VB.NET 2003. At the moment I generate ASP-Sites. The database is MySQL. If I pass only the main-Report-Dataset to the main-report, all is working fine, but if the report contains a subreport, I get a Login-Box nad can't logon.

This is a part of my Source-Code:

Conn.Open()
DA_Pos.Fill(DS1.pos)
DA_Comment.Fill(DS1.comment)
Conn.Close()
Report.SetDataSource(DS1.pos)
PreReport.SetDataSource(DS1.comment)
CRViewer1.ReportSource = Report

Can you help me ?
 
Found my own solution:

Try
Conn.Open()
DA_Pos.Fill(DS1.pos)
DA_Comment.Fill(DS1.comment)
Conn.Close()
Report.Database.Tables.Item("Pos").SetDataSource(DS1.pos)
Report.Subreports(0).SetDataSource(DS1.comment)
'For the Subreports you can also use the name
'i.e. Report.Subreports("PreComment")....
Report.Subreports(1).SetDataSource(DS1.comment)
CRViewer1.ReportSource = Report
Catch ex As Exception
End Try

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top