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!

Server has not yet been opened !!! 1

Status
Not open for further replies.

Miksch

Programmer
Jul 20, 2002
8
0
0
US
My company has a reporting system that generates and exports Crystal Reports(V8.5) to a SQL2000 database in image format.
I have developed a VB6 Client app that retrieves the crystal report from the table using ADODB.Stream and loads the report file to the client workstation for viewing. The app works great on Win2K but, clients that have WinNT 4.0 I have been getting the "Server has not been opened yet" message on a few of the reports. I am a little confused here..
This is the process that I am using:

1. Pull the selected Report from the table and save it as a temp file on the client workstation.
2. Open the report using the CRAXDRT.App and the CRAXDRT.Report.
3. Assign the CrViewer.Datasource = Report
4. CrViewer.Viewreport

Any Help Would Be appreciated
 
I've seen this message in my development process before.
Are you able to access the SQL Server database from the client machine in question ?
Ensure that the CRViewer.dll + Crxdrt.dll are registered on the machine.
Ensure that you also have the required database access DLL's on the client machine - a list of these can be found in the CR help files (incluing p2sodbc.dll, p2ssql.dll, etc)
 
I am sure I have them all deployed. I am developing with the professional edition. Would you have a listing of the required files from the runtime.hlp file. Thanks.
 
report.database.tables(1).setlogoninfo "dsnname","databasename","username","password"
 
Rahul,

I am using that logon in the building of the report.What I am doing is running the report and exporting the completed report and storing it in a BLOB table. This application pulls the BLOB data from the table as saves it as a crystal report file with the data and displays the report in the viewer. I have had no problems doing this on the development PC. It has been hit and miss on other client machines. Thanks for the help..
 
OK, I have had the "Server Has Not Yet Been Opened" error problem. setting logon information seems to work, but I am wondering why it is that, even though I check "Allow Saving Password," it always loses that and asks me for the password for my OLE DB SQL Server connection the next time I go to that report. Any ideas?
 
I am experiencing a similar problem with the same error message ("Server has not yet been opened"). I have Crystal Viewer running on a Windows 2000 server with Citrix XP server. I can pull up a report and, as long as there are no prompts, the reports run fine. If there is a prompt, I get "Server has not yet been opened". If I login locally to the Citrix server, I can run any report - even the reports prompting for information.

Any suggestions?
 
I think you should check the existance of ODBC file with same neme used in "setlogoninfo" on the problem machine.

Good luck


 
Mikch,

If the reports that are not running contain subreports
they have to logged on to the database explicitly.
coding:
Sub ReportSetLogonInfo(UserId, Catalog, DataSource, Password )
Dim crtable
for each crTable in session("oRpt").Database.Tables
StripLocation(crTable)
crTable.SetLogonInfo CStr(datasource), CStr(catalog), CStr(userid), CStr(password)
next
End Sub
'--------------------------------------------------------------------

Sub SubreportSetLogonInfo(UserId, Catalog, DataSource, Password )
Dim CRXSections, CRXSection, CRXobject, CRXSubreport, CRXsubreports, CrSubtable
Set CRXSections = session("oRpt").Sections
For each CRXSection in CRXSections
For each CRXObject in CRXSection.ReportObjects
If CRXObject.Kind = 5 then 'Subreport
Set CRXSubreport = CRXObject.OpenSubreport
for each crSubTable in CRXSubreport.Database.Tables
StripLocation(crSubTable)
crSubTable.SetLogonInfo CStr(datasource), CStr(catalog), CStr(userid), CStr(password)
next
End IF
next
next
End Sub

Greetings,

Wim
 
Well Posselman is correct (if your problem is with subreports).. But our company has this problem without using subreports, and the answer is in the vb code, but a little easier before jumping into the problems of adding on subreports code logic which carry their own little boogiemen!

This may be a simplier and easier logic code for starters.

'This rpt calls only one table
Code:
Report1.Database.Tables.Item(1).SetLogOnInfo  CStr(datasource), CStr(catalog), CStr(userid), CStr(password)
Now if you have two or three tables to add on, then it would be
Report1.Database.tables.Item(2).SetLogonInfo ....etc.
Report1.Database.tables.Item(3).SetLogonInfo ....etc.
 
What if you don't need to logon to the db? I am running MS Access 2000 and CRD 8.0. I am having this problem and have tried to bypass the logon info but when I get to viewing the report it says that "Server has not yet been opened".

Any suggestions to issues with Access 2000?

I am very new at programming also.

Thanks,

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top