Greetings CR Gurus!
The following code works fine in our VB6 app with CR8.5 on all of our computers -- Windows XP, 2000, and 98. However, with our recent upgrade to CR9, we get an OVERFLOW error on the Windows 98 boxes. Upgrading from 98 isn't an option at this time, so we need to understand what is causing this error. Can anyone solve this mystery? We have spent many hours on this.
We call the report from a VB6 app with code pasted below. When we step through it, it blows up on the line:
CRViewer1.ViewReport
It's as if the CRViewer isn't right somehow with Windows 98.
The error is a Microsoft Visual Basic message box that reads:
Runtime error 6: Overflow
Our code:
'We set the Crystal objects
Set CRReport = Nothing
Set CRReport = New CRAXDRT.Report
Set CrxApp = Nothing
Set CrxApp = CreateObject("crystalruntime.application.9")
Set CRXSubReport = Nothing
Set CRXSubReport = New CRAXDRT.Report
Set CRXSubReport2 = Nothing
Set CRXSubReport2 = New CRAXDRT.Report
'Next we run the stored procedure
(Didn't paste all of the code for that...)
'Then we set and pass the parameters to Crystal
(Didn't paste all of the code for that...)
Set CRReport = CrxApp.OpenReport(gReport_Location & gstrReport & ".rpt")
Set CRXParamDefs = CRReport.ParameterFields
For Each CRXParamdef In CRXParamDefs
With CRXParamdef
Select Case .ParameterFieldName
Case "SEASON_YEAR"
.SetCurrentValue Left(cboSeason.Text, 7)
Case "CCN"
.SetCurrentValue Left(cboCCN.Text, 3)
Case "FASHION_LABEL"
.SetCurrentValue Left(cboLabel.Text, 4)
Case "SESSION"
.SetCurrentValue iCurrentSession
Case "Division_Name"
.SetCurrentValue "92"
Case "REPORT_FOOT"
.SetCurrentValue sReport_Foot
End Select
End With
Next
'Next we set the location
Dim CRconn As CRAXDRT.ConnectionProperties
Set CRconn = CRReport.Database.Tabl(1).ConnectionProperties
CRReport.Database.Tables(1).DllName = "crdb_ado.dll"
CRconn.DeleteAll
CRconn.Add "Provider", "SQLOLEDB"
CRconn.Add "Data Source", gSqlServer
CRconn.Add "Initial Catalog", "OurAppName"
CRconn.Add "User ID", "OurAppName"
CRconn.Add "Password", "OurPassword"
'Lastly, we load and show the form that has the CR Viewer
Load frmViewReport '(see the form load code below)
frmViewReport.Show
'This is the form_load code for frmViewReport.
Me.Height = 7800
Me.Width = 11930
Me.Top = 0
Me.Left = 0
CRViewer1.Height = 7510
CRViewer1.Width = 11940
CRViewer1.ReportSource = CRReport
CRViewer1.DisplayGroupTree = False
CRViewer1.EnableExportButton = True
CRViewer1.EnableCloseButton = True
If bPreview = True Then
CRViewer1.ViewReport 'BLOWS UP ON THIS LINE
DoEvents
Else
If bPopUpPrinterBox = False Then
CRReport.PrintOut True, 1, True
Else
CRReport.PrintOut False
End If
DoEvents
End If
This is a hair puller. Thanks.
Tracey
The following code works fine in our VB6 app with CR8.5 on all of our computers -- Windows XP, 2000, and 98. However, with our recent upgrade to CR9, we get an OVERFLOW error on the Windows 98 boxes. Upgrading from 98 isn't an option at this time, so we need to understand what is causing this error. Can anyone solve this mystery? We have spent many hours on this.
We call the report from a VB6 app with code pasted below. When we step through it, it blows up on the line:
CRViewer1.ViewReport
It's as if the CRViewer isn't right somehow with Windows 98.
The error is a Microsoft Visual Basic message box that reads:
Runtime error 6: Overflow
Our code:
'We set the Crystal objects
Set CRReport = Nothing
Set CRReport = New CRAXDRT.Report
Set CrxApp = Nothing
Set CrxApp = CreateObject("crystalruntime.application.9")
Set CRXSubReport = Nothing
Set CRXSubReport = New CRAXDRT.Report
Set CRXSubReport2 = Nothing
Set CRXSubReport2 = New CRAXDRT.Report
'Next we run the stored procedure
(Didn't paste all of the code for that...)
'Then we set and pass the parameters to Crystal
(Didn't paste all of the code for that...)
Set CRReport = CrxApp.OpenReport(gReport_Location & gstrReport & ".rpt")
Set CRXParamDefs = CRReport.ParameterFields
For Each CRXParamdef In CRXParamDefs
With CRXParamdef
Select Case .ParameterFieldName
Case "SEASON_YEAR"
.SetCurrentValue Left(cboSeason.Text, 7)
Case "CCN"
.SetCurrentValue Left(cboCCN.Text, 3)
Case "FASHION_LABEL"
.SetCurrentValue Left(cboLabel.Text, 4)
Case "SESSION"
.SetCurrentValue iCurrentSession
Case "Division_Name"
.SetCurrentValue "92"
Case "REPORT_FOOT"
.SetCurrentValue sReport_Foot
End Select
End With
Next
'Next we set the location
Dim CRconn As CRAXDRT.ConnectionProperties
Set CRconn = CRReport.Database.Tabl(1).ConnectionProperties
CRReport.Database.Tables(1).DllName = "crdb_ado.dll"
CRconn.DeleteAll
CRconn.Add "Provider", "SQLOLEDB"
CRconn.Add "Data Source", gSqlServer
CRconn.Add "Initial Catalog", "OurAppName"
CRconn.Add "User ID", "OurAppName"
CRconn.Add "Password", "OurPassword"
'Lastly, we load and show the form that has the CR Viewer
Load frmViewReport '(see the form load code below)
frmViewReport.Show
'This is the form_load code for frmViewReport.
Me.Height = 7800
Me.Width = 11930
Me.Top = 0
Me.Left = 0
CRViewer1.Height = 7510
CRViewer1.Width = 11940
CRViewer1.ReportSource = CRReport
CRViewer1.DisplayGroupTree = False
CRViewer1.EnableExportButton = True
CRViewer1.EnableCloseButton = True
If bPreview = True Then
CRViewer1.ViewReport 'BLOWS UP ON THIS LINE
DoEvents
Else
If bPopUpPrinterBox = False Then
CRReport.PrintOut True, 1, True
Else
CRReport.PrintOut False
End If
DoEvents
End If
This is a hair puller. Thanks.
Tracey