I have a CR8 report created that uses the Active Data Driver to connect to an Access 2000 database or SQL Server 2000 database. The report contains three recordsets, two of which are linked and placed in the details section. The third recordset is in the page header section and is not linked to the other recordsets (there is only one record in the recordset that applies to the entire report). I can choose either database type from CR8 and the report displays properly.
I then tried this report in Visual Basic 6 using the Crystal Automation Server. I can connect to either type of database in code and pass the recordsets using the "SetPrivateData" method of the CRPEAuto.DatabaseTable object. The report displays, but the fields in the Page Header are blank. This is my code for setting the recordsets:
[tt]
For k = 1 To DbTables.Count
Set DbTable = DbTables.Item(CInt(k))
Set cnnRpt = New ADODB.Connection
'IsJetProvider() is a function to determine db type
If IsJetProvider() Then
cnnRpt.Open strAccess
Else
cnnRpt.Open strSQLServer
End If
Set rsRpt = New ADODB.Recordset
rsRpt.Open "SELECT * FROM [" & DbTable.Name & "]", SLARREP.cnn
DbTable.SetPrivateData 3, rsRpt
Next k
[/tt]
Do I have to set any properties for the "crPageHeader" section of the report? Any suggestions??
I then tried this report in Visual Basic 6 using the Crystal Automation Server. I can connect to either type of database in code and pass the recordsets using the "SetPrivateData" method of the CRPEAuto.DatabaseTable object. The report displays, but the fields in the Page Header are blank. This is my code for setting the recordsets:
[tt]
For k = 1 To DbTables.Count
Set DbTable = DbTables.Item(CInt(k))
Set cnnRpt = New ADODB.Connection
'IsJetProvider() is a function to determine db type
If IsJetProvider() Then
cnnRpt.Open strAccess
Else
cnnRpt.Open strSQLServer
End If
Set rsRpt = New ADODB.Recordset
rsRpt.Open "SELECT * FROM [" & DbTable.Name & "]", SLARREP.cnn
DbTable.SetPrivateData 3, rsRpt
Next k
[/tt]
Do I have to set any properties for the "crPageHeader" section of the report? Any suggestions??