janakrajani
Programmer
I am using VB 6.0 and SCR 8.0.
From VB6.0, I am referencing SCR 8.0.
Now when I hit DISPLAY REPORT from the VB form, I get the following error :
Run-time error -2147192184(80047288): 'Server has not yet been opened'.
My code is as follows :
=================================================
Dim crxApplication As New CRAXDRT.Application
Dim crxReport As New CRAXDRT.Report
...
...
'logon the server to get the report data
crxApplication.LogOnServer "P2ssql.dll", "server", "dbname", "user_id", "pwd"
'open the report
Set crxReport = crxApplication.OpenReport(App.Path + ("\Deny.rpt")
'pass the value of parameter from VB to SCR
crxReport.ParameterFields.Item(1).AddCurrentValue (Val(txtYear.Text))
'pass the value of the second parameter from VB to SCR
crxReport.ParameterFields.Item(2).AddCurrentValue (Val(txtRegionNum.Text))
'set the report source
CRViewer1.ReportSource = crxReport
'finally display the report
CRViewer1.ViewReport
========================================================
Can anyone tell me where I am wrong ?
Please treat this as urgent....
Thanks in advance.
From VB6.0, I am referencing SCR 8.0.
Now when I hit DISPLAY REPORT from the VB form, I get the following error :
Run-time error -2147192184(80047288): 'Server has not yet been opened'.
My code is as follows :
=================================================
Dim crxApplication As New CRAXDRT.Application
Dim crxReport As New CRAXDRT.Report
...
...
'logon the server to get the report data
crxApplication.LogOnServer "P2ssql.dll", "server", "dbname", "user_id", "pwd"
'open the report
Set crxReport = crxApplication.OpenReport(App.Path + ("\Deny.rpt")
'pass the value of parameter from VB to SCR
crxReport.ParameterFields.Item(1).AddCurrentValue (Val(txtYear.Text))
'pass the value of the second parameter from VB to SCR
crxReport.ParameterFields.Item(2).AddCurrentValue (Val(txtRegionNum.Text))
'set the report source
CRViewer1.ReportSource = crxReport
'finally display the report
CRViewer1.ViewReport
========================================================
Can anyone tell me where I am wrong ?
Please treat this as urgent....
Thanks in advance.