Hi all,
I am using VB6 and connecting to a SQL 2000 db using SQL authentication.
I am trying to run a Crystal Report for one of the tables. I have set up the report using the designer and an ODBC source with SQL authentication. The report runs fine from the designer but when I try to open it using the Viewer, it gives the following error...
"The server has not yet been opened"
Dim crystal As CRAXDRT.Application
Dim crRep As CRAXDRT.Report
Dim cParam As CRAXDRT.ParameterFieldDefinition
Dim cParams As CRAXDRT.ParameterFieldDefinitions
ShowWorkTypeReport = False
Set crystal = New CRAXDRT.Application
Set crRep = crystal.OpenReport(g_sWorkTypeReport)
Set cParams = crRep.ParameterFields
For Each cParam In cParams
With cParam
Select Case .ParameterFieldName
Case "WorkType"
.AddCurrentValue sWorkType
Case "StartDate"
.AddCurrentValue dtStartDate
Case "EndDate"
.AddCurrentValue dtEndDate
End Select
End With
Next cParam
crRep.EnableParameterPrompting = False
crvLog.ReportSource = crRep
crvLog.ViewReport
Can anyone tell me why this is happening? I did manage to open the report throught the viewer yesterday a couple of times but not since.
Any help very gratefully received!
Thanks,
Robin
I am using VB6 and connecting to a SQL 2000 db using SQL authentication.
I am trying to run a Crystal Report for one of the tables. I have set up the report using the designer and an ODBC source with SQL authentication. The report runs fine from the designer but when I try to open it using the Viewer, it gives the following error...
"The server has not yet been opened"
Dim crystal As CRAXDRT.Application
Dim crRep As CRAXDRT.Report
Dim cParam As CRAXDRT.ParameterFieldDefinition
Dim cParams As CRAXDRT.ParameterFieldDefinitions
ShowWorkTypeReport = False
Set crystal = New CRAXDRT.Application
Set crRep = crystal.OpenReport(g_sWorkTypeReport)
Set cParams = crRep.ParameterFields
For Each cParam In cParams
With cParam
Select Case .ParameterFieldName
Case "WorkType"
.AddCurrentValue sWorkType
Case "StartDate"
.AddCurrentValue dtStartDate
Case "EndDate"
.AddCurrentValue dtEndDate
End Select
End With
Next cParam
crRep.EnableParameterPrompting = False
crvLog.ReportSource = crRep
crvLog.ViewReport
Can anyone tell me why this is happening? I did manage to open the report throught the viewer yesterday a couple of times but not since.
Any help very gratefully received!
Thanks,
Robin