Hi all,
I have Crystal Reports version 8.0.1.0
I use the CRViewer that allows me to connect my Visual Basic 6 Application with reports that are generated with Crystal Reports. The connection is a native connection with MS ACCESS 2000.
My problem is to connect my database to a subreport.
To connect to my report i use the code in VB6.0
--------start code---------------------
Dim appn As New CRAXDRT.Application
Dim CRXReport As New CRAXDRT.Report
Dim CRXDatabase As CRAXDRT.Database
Dim CRXTable As CRAXDRT.DatabaseTable
Dim CRXTables As CRAXDRT.DatabaseTables
Dim CRXParams As CRAXDRT.ParameterFieldDefinition
On Error GoTo rapportdefinitie_error
Set CRXReport = appn.OpenReport(dbSettings.rapportpad & "\" & Cr_rapportlok)
Set CRXTables = CRXReport.Database.Tables
Set CRXTable = CRXTables.Item(1)
If Cr_SelectQuery <> "" Then
CRXReport.ParameterFields(1).AddCurrentValue (Cr_SelectQuery)
Else
CRXReport.ParameterFields(1).AddCurrentValue (""
End If
CRXTable.Location = dbSettings.path
etc.
--------------------- end code -------------------
My database is not in the same directory as the report-files. The question is: How can i set the databaselocation for the subreport in VB code??
Thanks in advance...
I have Crystal Reports version 8.0.1.0
I use the CRViewer that allows me to connect my Visual Basic 6 Application with reports that are generated with Crystal Reports. The connection is a native connection with MS ACCESS 2000.
My problem is to connect my database to a subreport.
To connect to my report i use the code in VB6.0
--------start code---------------------
Dim appn As New CRAXDRT.Application
Dim CRXReport As New CRAXDRT.Report
Dim CRXDatabase As CRAXDRT.Database
Dim CRXTable As CRAXDRT.DatabaseTable
Dim CRXTables As CRAXDRT.DatabaseTables
Dim CRXParams As CRAXDRT.ParameterFieldDefinition
On Error GoTo rapportdefinitie_error
Set CRXReport = appn.OpenReport(dbSettings.rapportpad & "\" & Cr_rapportlok)
Set CRXTables = CRXReport.Database.Tables
Set CRXTable = CRXTables.Item(1)
If Cr_SelectQuery <> "" Then
CRXReport.ParameterFields(1).AddCurrentValue (Cr_SelectQuery)
Else
CRXReport.ParameterFields(1).AddCurrentValue (""
End If
CRXTable.Location = dbSettings.path
etc.
--------------------- end code -------------------
My database is not in the same directory as the report-files. The question is: How can i set the databaselocation for the subreport in VB code??
Thanks in advance...