Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exported Report - Open in Crviewer Gets "server has not been open yet"

Status
Not open for further replies.

Miksch

Programmer
Jul 20, 2002
8
0
0
US
I have a VB6 application that uses the crviewer to open the exported crystal report. If I open it on the PC that I developed the application on it opens the report fine. But, if I open the report on another PC I get an error that the "Server has not been opened yet". I have deployed the required library files to the new PC using the Packaging and Deployment Wizard. Any help will be appreciated.
 
This may be a long shot and it may be something you have already thought of. Does your database require an ODBC Connection? If so, you will need to set one up on the 2nd PC. This could account for the error message you are seeing.
 
The 2nd PC has the ODBC connections that are required by the report. When I was comparing this report to other reports that we have I was only able to find one thing that was different. The other reports only use a stored procedure for a data source. This report has a stored procedure and accesses 2 tables on the same database.
 
What code are you using to logon to the databases? What integration method are you using? (RDC, ocx etc)
 
The reports use an ODBC connection to connect to the database. Every report's login information is stored in a database table. Basicly what I do is do a query on the table for the particular report ID and then pull back the logon information for that report and then just loop through it in sequence and set the login information.

Dim crxApp as CRAXDRT.Application
Dim crxReport as CRXDRT.Report
Dim crxDBTable as CRAXDRT.DataBaseTable

Set crxApp = New CRAXDRT.Application
Set crxReport = crxApp.OpenReport(TargetPath, 1)
crxReport.DiscardSavedData
While Not RS.EOF
Set crxDBTable = crxReport.Database.Tables.Item(CLng(RS("Seq")))
crxDBTable.SetLogOnInfo CStr(Trim(RS("ServerName"))), CStr(Trim(RS("DbName"))), CStr(Trim(RS("RptUserID"))), CStr(Trim(RS("RptPassword")))

RS.MoveNext
Wend
RS.Close
Set RS = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top