I use 2 sub reports in my crystal report. Both these reports are not have any link or relation to each other. but have relation with main report with evidence.
my code :
dim mReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
dim querymain, query1, query2 As String
mReport = New CrystalReport1
querymain = "SELECT * from tblmain where evidence = '" & EvD & "'"
Call DataSourceConnection_Report() 'my setconnection and setlogon
mReport.Database.Tables(0).SetDataSource(ExecuteSQLQuery(querymain))
query1 = "SELECT * FROM tbl1 WHERE EVIDENCE = '" & EvD & "'"
mReport.Subreports("sub2").SetDataSource(ExecuteSQLQuery(query1))
query2 = "SELECT * FROM tbl2 WHERE EVIDENCE = '" & EvD & "'"
mReport.Subreports("sub3").SetDataSource(ExecuteSQLQuery(query2))
CrystalReportViewer1.Refresh()
CrystalReportViewer1.ReportSource = mReport
but it will only show my main report data and leave my sub report empty.
how to fill my sub report ?