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!

Populating Subreport using Active Data definition "TTX"

Status
Not open for further replies.
Jun 27, 2004
8
US

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.......






 
First, some clarification. Did you design your report with a TTX file, or did you use an XML schema? I've only used TTX with VB 6, and have used XML with .Net. Therefore, my advice may not correctly help you.

That said, if this report was based off of an XML schema, what I would suggest would be to get a DataSet with tables and fields that match your report definitions. Then, pass the whole DataSet to the report. I'm not sure that it will work, but it seems to be the most logical place to start.
 
Yes. Thanks for the reply. much better if could give a sample in vb6 on how to populate the subreport?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top