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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Again - "Server has not yet been opened" - using RDC

Status
Not open for further replies.

rdharmar

IS-IT--Management
Jun 20, 2001
54
US
I am trying to use the RDC for the first time. I have imported an existing .RPT file and added the report viewer to my VB project. The reference material I have been referring to states that:

"The report inside your VB application will use the same data source as the imported report did. These data sources are all provided by crystal Reports functionality, seperate from any database-connectivity features within VB"

When I originally compiled the Report, the database location is set to or table that it points to is a stored procedure.

Qn1. What code am I missing to view the report in the CRViewer1 control? I have been using the default code that comes along when I added the RDC.

Thanks





 
You have to logon to the server where the stored procedure is located. You can do this in the following way..

Report.Database.Tables(1).SetLogOnInfo "ServerName", "DBName", "UserID", "Password"

Where Report is the report you're trying to view.

Hope this helps.

Doug
 
Thanks, I have made some progress but I am getting a "invalid cursor state" error message. Any ideas!
By the way I am working with SQL server.
 
Oops. I am sorry I did not pass the server and database name correctly, but after fixing this I get a error message "server has not yet been opened"
 
Basically don't use DSN's in any shape or form..they are too problematic, short of installing the full Crystal app on your client. What you need to do is use ADO recordsets to gather the data for your report. Go to the Crystal web site and download the following document:
Using Data Definition (TTX) files to pass an ADO recordset to a Crystal Report.
I'm sure other people know this factoid, but don't seem to want to share it as I've seen lot's of these posts...

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top