countdigit
Programmer
hi guys, i'm new to crystal report. when i was still using crystal report (last week) 8.x this code WAS UP AND RUNNING, until i found out that i have to upgrade to 9.
1. already recreated by rpt's using version 9, including the ttx's
2. i uninstalled, restarted my computer, installed 9
3. check my vb project's references components and updated them to v9.
4. this fix from crystal decision: cr90devwin_en.zip
but i still keep on getting this message:
Method 'ReportSource' of object 'ICrystalReportViewer9' failed
... on this line:
frmPickSlipViewer.CRViewer91.ReportSource = CRXReport
and no report appears.
why?
if there are any good souls out there please help shed a light on this matter. any help would truly be appreciated. thanks in advance.
below are excerpts from my code...
' HERE ARE MY DECLARATIONS
Global gCon As ADODB.Connection 'global connection object
Global CRXApplication As New CRAXDRT.Application
Global CRXReport As New CRAXDRT.Report
Global CRXDatabase As CRAXDRT.Database
Global rs As New ADODB.Recordset
Global Report As New CrystalReport1
'HERE IS MY CODE
With rs
.Source = vsSQL
.ActiveConnection = gCon
.LockType = adLockOptimistic
.CursorLocation = adUseClient
.Open
End With
curpath = CurDir()
If optPickSlip.Value = True Then
Set CRXReport = CRXApplication.OpenReport(curpath & "\GlobalPickList.rpt", 1)
Else
Set CRXReport = CRXApplication.OpenReport(curpath & "\GlobalSOList.rpt", 1)
End If
CRXReport.DiscardSavedData
Set CRXDatabase = CRXReport.Database
CRXDatabase.SetDataSource rs, 3, 1
frmPickSlipViewer.CRViewer91.Refresh
' THIS IS WHERE THE DREADED MESSAGE APPEARS (OK BEFORE I UPGRADED TO v9... PROMISE)
frmPickSlipViewer.CRViewer91.ReportSource = CRXReport
frmPickSlipViewer.Show 1
1. already recreated by rpt's using version 9, including the ttx's
2. i uninstalled, restarted my computer, installed 9
3. check my vb project's references components and updated them to v9.
4. this fix from crystal decision: cr90devwin_en.zip
but i still keep on getting this message:
Method 'ReportSource' of object 'ICrystalReportViewer9' failed
... on this line:
frmPickSlipViewer.CRViewer91.ReportSource = CRXReport
and no report appears.
why?
if there are any good souls out there please help shed a light on this matter. any help would truly be appreciated. thanks in advance.
below are excerpts from my code...
' HERE ARE MY DECLARATIONS
Global gCon As ADODB.Connection 'global connection object
Global CRXApplication As New CRAXDRT.Application
Global CRXReport As New CRAXDRT.Report
Global CRXDatabase As CRAXDRT.Database
Global rs As New ADODB.Recordset
Global Report As New CrystalReport1
'HERE IS MY CODE
With rs
.Source = vsSQL
.ActiveConnection = gCon
.LockType = adLockOptimistic
.CursorLocation = adUseClient
.Open
End With
curpath = CurDir()
If optPickSlip.Value = True Then
Set CRXReport = CRXApplication.OpenReport(curpath & "\GlobalPickList.rpt", 1)
Else
Set CRXReport = CRXApplication.OpenReport(curpath & "\GlobalSOList.rpt", 1)
End If
CRXReport.DiscardSavedData
Set CRXDatabase = CRXReport.Database
CRXDatabase.SetDataSource rs, 3, 1
frmPickSlipViewer.CRViewer91.Refresh
' THIS IS WHERE THE DREADED MESSAGE APPEARS (OK BEFORE I UPGRADED TO v9... PROMISE)
frmPickSlipViewer.CRViewer91.ReportSource = CRXReport
frmPickSlipViewer.Show 1