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!

Visual Basic passing parameters to Crystal Report

Status
Not open for further replies.

flager

Technical User
Jan 10, 2002
6
US
I developed a Crystal Report 8.5 that utilizes parameters. I then created a VB 6 application to call up the report and under the project menu imported the report with 'Add Crystal Report 8.5'. Everything was fine until I saved the project. Having saved the project, I ran the VB application and got to the point where I select the parameters for the report. I select the parameters, hit OK and then get a message 'Server has not yet been opened' This only occurs once I have saved the project. Does anyone have a solution to this matter ie. code etc. Thanks, Fred (Novice User of both Crystal and VB)
 
I had the same problem with crystal the way I fixed it was to set the connection to the server in the VB script, I placed this just before displaying the report. This is the line I used to do it.

Code:
CrxReport.Database.Tables(1).SetLogOnInfo "Server", , "Username", "Password"

When I was looking I did find a number of commands which would all achive the some thing. I don't know if one of the others would be better.
BTW I was connecting to an Oracle Database, I think that the missing Param (the 2nd one) is used to set the database name for things like MS-SQL server.

I hope this helps you

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top