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

how do i open a crystal reports report if... 1

Status
Not open for further replies.

Paladyr

Programmer
Apr 22, 2001
508
US
...the database with the information it is connected to is password protected??? Could someone provide some sample code?? Thanks!
 
faq149-237 Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
1) The version of Crystal Reports you are using.
When I go to help, about crystal reports, this is the only thing relating to the product version I see:

Product: 8.5.0.217
Created on: 2/09/2001


2) How your report connects to the data (ODBC or Direct)
Direct. I basically just browse to the database file and then select the tables that I want. It prompts me for a password there but when I run it, it doesn't work. ODBC contains just the drivers to connect to a database doesn't it??? How would you connect to the database using ODBC??? Does it store the location of the database somewhere? Whenever I try to connect using ODBC it asks me for login information.

If you are programming also include:
3) The version of VB (or other language) you are using.
Visual Basic 6.0

4) The Integration method you are using:
I haven't even integrated it yet, i'm just trying to get it to run correctly.
1. OCX (Crystal32.ocx)
2. RDC (CraxDrt.dll/CraxDui.dll)
3. Automation Server (CPEAUT32.dll).
4. API
 
Are you trying to run the report from within Crystal reports or from your app. There is no 'code' within CR. You should get the user/password box and enter them. However, if there are any problems with accessing the data (premissions, bad drivers, etc) you will still get a password prompt. It is misleading.

If you are writing any code in the app to launch the report, then you have to select an integration method and add the appropriate components and references first. That determines which code you use. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
When I create the report, it asks if I want to have a print preview form automatically created and I select yes. I then browse to the database and when I select it, it asks for the password, I enter it, and I am connected to the database. However when I open the form that allows me to see the report in print preview, it DOES NOT ask me for the password and instead gives me an error message. I then close the form, go back to the database and test the connection and it says it is fine. I can do this just fine when i am using a database without a password. I am not using any code, this is all being done inside crystal reports.
 
This might seem strange but you are not in Crystal Reports (CRW32.exe). You are inside VB using Crystal's Report Design Component, or RDC which is also your integration method. So you must have added the RDC components and references to your report already. What components and references did you add to the project?

Also, what is the error message? What is your database, MS Access? ODBC connects using an ODBC Driver as opposed to the native driver and changes a few connection properties.

Last, look up the commands SetLogonInfo or LogonServer, as you might need one of those to send username and password from the app. However, I think you should be able to preview the RDC without this info? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I load it by going to Start, Programs, Crystal Reports Tools, then crystal reports. That seems like it is seperate from VB???? Is that still just a component of VB?? I haven't added any references... just started up Crystal Reports. I guess I shouldn't have included the VB 6.0 in those questions you asked since I am really not coding this report yet... I will look up those methods and give them a try. Thanks!
 
I am confused. Your last post shows you ARE in Crystal Reports. But the post before that said:

"When I create the report, it asks if I want to have a print preview form automatically created and I select yes."

That is a question from the RDC. I have no idea where you are. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Okay wait, I was wrong, I add the report from Visual Basic and it creates that form :). Sorry :). I guess that since I am initializing the form when I view it in Visual Basic, I am going to have to supply the password before connecting to the database. I think that makes sense :). Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top