I am using the newest version of CR and I am trying to convert my reports from an older version of CR (8.5).
Some of my reports do not contain a link to a database or contain field definitions (TTX,XML). In VB6, I simply set the Datasource to the ADO.Recordset then issued a .ReadRecords. I need to be able to do this still. Below is a watered down example of what my older VB6/CR8.5 did:
Private Function MyReport00() As Boolean
Dim strSQL As String
Dim iRow As Integer
strSQL = "SELECT * "
strSQL = strSQL & "FROM MYTABLE"
moRS.Open strSQL, moLogin.Connection(moLogin),adOpenStatic, adLockReadOnly, adCmdText
If Not moRS.EOF Then
Set CrAppl = New Application
Set moCrystalReport = CrAppl.OpenReport(moRpt2Make)
With moCrystalReport
.Database.AddADOCommand moRS.ActiveConnection, moRS.ActiveCommand
.Database.SetDataSource moRS, 3
.AutoSetUnboundFieldSource crBMTName
.ReadRecords
End With
End If
Exit Function
I am mainly trying to figure out how to make this block work:
With moCrystalReport
.Database.AddADOCommand moRS.ActiveConnection, moRS.ActiveCommand
.Database.SetDataSource moRS, 3
.AutoSetUnboundFieldSource crBMTName
.ReadRecords
End With
Then on my report I have about 5-10 Formula Fields that contain this:
WhileReadingRecords;
Space(10)
Then when my report loads all my data displays as desired.
If I need to convert my Recordset to a DataSet/DataView that wouldnt be a huge change, but having to adjust all my Formula Fields that use the While Reading Records would be a huge change and lots of work. Is there a way to use Datasets/DataViews as the Datasource but have a Database Fields table linked to the report?
Any help would greatly be appreciated.