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

New User needs help incorporating and printing reports

Status
Not open for further replies.

Stuartp

Technical User
Feb 22, 2001
178
GB
I have just started creating Crystal Reports, and I have created a report that shows exactly the data I want in the preview screen. Can someone please tell me what code I need to send this report to the printer. I have tried the reportName.action = 1 code but that produces a log on error even though my database does not have any passwords on it.

Also, this report needs to show different data each time as the data changes when the report is run. Will this happen automatically as the database is refreshed or is there something else I need to do?

Finally, does it matter that my users will not have Crystal Reports installed and if so what files do I need to put in their machines and where?

Many thanks in advance,

Stuart
 
What version of CR are you using, and which technique are you using to launch the report.

As long as you don't save data with the report, you will get fresh data whenever it is run.

The logon error usually means that the ODBC connection wasn't set up correctly on the PC. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I am using CR 4.6 that came with VB 6.0. At the moment I am not using any technique to launch the report. I have just designed it in the Crystal Application and can preview it in the preview window, but I do not know how to make the report available in my VB application. This was where I placed the Crystal Report Control on the form, pointed it at my database and used the code I mentioned but got the log on error.

With regard to that log on error and setting up ODBC, I just selected Microsoft Access Database in the screen where it said to set this up.

Once I have been able to set this up so that users can just click a button and print the report, I was wondering what additional files I need to bundle in my app for the users and where they need to be installed for the whole package to work.

Many thanks.

Stuart
 
What is the exact error message?
Are you currently running the report on the same PC as the report was designed? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Yes I am trying to run the report on the same PC as where it was designed.

The exact error message is: "Unable to connect: incorrect log on parameters"

Stuart
 
What database platform are you trying to connect to?

What report commands are you using before action = 1?
Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I am trying to connect to a Microsoft Access 2000 database.

The only command I have entered so far is CrystalReport1.Action = 1

Stuart
 
I don't think so, I don't even know what you mean by this!

Stuart
 
I called my report CrystalReport1, which was why I used the line of code: CrystalReport1.Action = 1 which I got from a book. I assumed that it would pick up the name of the report from this and run it the way it does for Microsoft Data Reports. This is where it produces the log in error.
 
>>I called my report CrystalReport1

Do you mean just the name of the file saved externally, or did you name it somewhere in the program. Somewhere in the program you need to give the path to the report.

CrystalReport1.ReportFileName = "c:\reports\testreport.rpt"


I assume you have the Crystal Report control in the project and on the form? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Ken,

I did have the Crystal Report control on my form, and in the properties for the report file name it pointed to the report file. For good measure I put the line of code in as well, but I am still getting the incorrect log on parameters message.

Is it possible that Crystal Reports 4.6 that I have just won't work with Access 2000? If this was the case though I would have thought it would not have connected with the database at all...

Stuart
 
I checked previous posts, and found the following 2 that might point you in the right direction:

--------
I had precisiely the same problem a few weeks ago. The necessary driver to allow CR 4.6.1.0 to communicate with Access2000 is available from the Microsoft web site.
----------
We ran into the same problem and found that the client machines had an old version of MFC42.dll. There is a previous Tek-Tips reply in the Seagate: Crystal Reports forum that helped me out (search for 'CR8 Physical Database not found', written by andybee on July 7, 2000) Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks, this has helped me. Apparently if we want to use Access 2000 we have to upgrade to Crystal Report 7. If the person above found the right file on Microsoft.com he is not saying where and I can't find it now, so it looks like I'll have to go back to Access 97 ;-(

One last thing then. What are the files that I need to include in the report so that other people can view it, print it or whatever? The books and files say we need to send some .dll files or something but not which ones.

Thanks,

Stuart
 
There is a new area devoted to CR Integration. You should start a new question there. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top