noel241977
MIS
I have created a parent crystal report having a subreport.
Here's the code
Private Sub cmdprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdprint.Click
Dim frm As New Frmreport
Dim data As DataSet
Dim subdata As DataSet
Dim rpt As New Sample1
data = recordset("select code,lastname+', '+firstname as Name from profile order by 2", conn)
subdata = recordset("select code,seminar,venue from seminar", conn)
'Parent "Populating the parent crystal report"
rpt.SetDataSource(data.Tables(0))
'Subreport "Populating the subreport"
'None
rpt.RecordSelectionFormula = "{sample_ttx.code} ='" & DataGrid1.Item(DataGrid1.CurrentRowIndex, 0) & "' "
rpt.Refresh()
With frm
.rptViewer.ReportSource = rpt
'.rptViewer.SelectionFormula = "{sample_ttx.code} ='" & DataGrid1.Item(DataGrid1.CurrentRowIndex, 0) & "' "
.ShowDialog()
End With
data = Nothing
subdata = Nothing
End Sub
The question is how am i going to populate the subreport inside the parent crystal Report?
Please help me.......