Hi,
I have a report with two recordsets. The "parent" recordset shows, however the "child" recordset come up as blank each time, even though the corresponding ADO object contains the data i need. I cannot get both recordsets to display. Crystal is just not reading the data contained in the "child" recordset. I am using two TTX files, one for the parent recordset, and one for the child recordset.
I'm using CR 8.5 and VB 6 and use ADODB to get the data.
Here is a sample of my code:
Dim objConn As New ADODB.Connection
Dim rs As ADODB.Recordset
Dim rs2 as ADODB.Connection
Dim CRXApplication As New CRAXDRT.Application
Dim CRXReport As CRAXDRT.Report
Private Sub Command1_Click()
Dim CRXDatabase As CRAXDRT.Database
Dim intNr As Integer
Dim strSQL As String
Dim strSQL2 AS String
intNr = 9
Set CRXReport = CRXApplication.OpenReport("\sosrapport.rpt", 1)
Set CRXDatabase = CRXReport.Database
strSQL = strSQL & "select DATA from TABLE where ID = intNr"
strConnString = "Provider=SQLOLEDB;Data Source=***;Initial Catalog=***; User Id=***;Password=***"
objConn.Open strConnString
Set rs = objConn.Execute(strSQL)
Set rs2 = objConn.Execute(strSQL2)
CRXDatabase.SetDataSource rs, 3, 1
CRXDatabase.SetDataSource rs2, 3, 2
'CRXReport.PrintOut
CRXReport.Export True
Set rs = Nothing
Set rs2 = Nothing
Set objConn = Nothing
End Sub
I have a report with two recordsets. The "parent" recordset shows, however the "child" recordset come up as blank each time, even though the corresponding ADO object contains the data i need. I cannot get both recordsets to display. Crystal is just not reading the data contained in the "child" recordset. I am using two TTX files, one for the parent recordset, and one for the child recordset.
I'm using CR 8.5 and VB 6 and use ADODB to get the data.
Here is a sample of my code:
Dim objConn As New ADODB.Connection
Dim rs As ADODB.Recordset
Dim rs2 as ADODB.Connection
Dim CRXApplication As New CRAXDRT.Application
Dim CRXReport As CRAXDRT.Report
Private Sub Command1_Click()
Dim CRXDatabase As CRAXDRT.Database
Dim intNr As Integer
Dim strSQL As String
Dim strSQL2 AS String
intNr = 9
Set CRXReport = CRXApplication.OpenReport("\sosrapport.rpt", 1)
Set CRXDatabase = CRXReport.Database
strSQL = strSQL & "select DATA from TABLE where ID = intNr"
strConnString = "Provider=SQLOLEDB;Data Source=***;Initial Catalog=***; User Id=***;Password=***"
objConn.Open strConnString
Set rs = objConn.Execute(strSQL)
Set rs2 = objConn.Execute(strSQL2)
CRXDatabase.SetDataSource rs, 3, 1
CRXDatabase.SetDataSource rs2, 3, 2
'CRXReport.PrintOut
CRXReport.Export True
Set rs = Nothing
Set rs2 = Nothing
Set objConn = Nothing
End Sub