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

VB5 w/Crystal Report Ctrl 4.6 - Crystal Info 6.0 - SQL Server

Status
Not open for further replies.

heybooba

MIS
Mar 10, 2001
11
US
I have a need to create a VB front end process to allow users to launch crystal reports from command buttons. Unfortunately, I don't know whatI'm doing. Does anyone have sample source code that they could share with me. In a nutshell, this is the code that I'm using ;
Private Sub CmdSQLFS_Click()
CrystalReport1.ReportFileName = "J:\cinfo\input\MICR\fsd_micr.rpt"
Result% = CrystalReport1.PrintReport
CrystalReport1.Action = 1
End Sub

I have also tried including CrystalReport1.Connect and
CrystalReport.LogOnServer ...with no success.
 
If you have installed INFO on the same PC you may run into problems, because of conflicting dlls.

What components/references have you added to the project? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks for the Info. Fortunately, Crystal Info has not been installed on my development PC.

COMPONENTS:
Crystal Report Control 4.6, MS ActiveX plugin

REFERENCES:
VB for Applications, VB runtime objects and procedures, VB object and procedures, OLE Automation, Crystal Report Control 4.6, ActiveX Type Library, MS ActiveX Plugin, and MS DAO 3.5 Object Library.
 
What does it do if you use the following in your Click?

CrystalReport1.ReportFileName ="J:\cinfo\input\MICR\fsd_micr.rpt"
CrystalReport1.PrintReport Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Sorry, you will also need the "connect" between these two lines, to log onto the server. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I added this line between ReportFilename and PrintReport.
CrystalReport1.Connect = "DSN = CCRPT1;UID = sa;PWD = password;DSQ = fsd"

Even after adding the CrystalReport1.Connect statement. I receive a "Run-Time error '20525' - Unable to load report" error message.

 
According to the Seagate KB, this error means that there is a problem with the file name or path. Do you have a typo or a permission problem?

Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I've gone over path and spelling many, many times. I've checked my ODBC(DSN) connectivity and it connects successfully. However, when I run Crystal Reports Pro (the version that ships with VB5), I can log on to the server but when I try to open the report, I get the dreaded "Unable to load report" error message.
 
Try moving the RPT so that it is a local file , in the root directory of the PC that is running the application. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Hi Ken. I transferred the report to the root drive of the machine requesting the report and I came up with the same "unable to load report" error message.
 
This report runs fine from CR 4.6 design environment, but can't be launche by the 4.6 ocx. I am stumped. It should work.

Can you try a different RPT? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
The report does NOT run from either the CR 4.6 design environment AND it can't be launche by the 4.6 ocx control.
So far, the only way that I can launch this report is by executing the report manually by using a computer that has the Crystal Info Desktop 6.0 installed and logs on to the APS.
I'll try a different report.
 
Well, no, you can't run a V6 report with V4.6. You have to create the report with 4.6 or upgrade your report design environment to CR 6.0. Info won't work because it doesn't use the print engine. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
THANKS!!! That error was driving me nuts. How do I upgrade my report design environment to CR 6.0?
 
Call Seagate and see if they still sell 6.0 Crystal Reports. (800)877-2340

You could upgrade to 7 or 8 also, since they can run older reports. But these reports wouldn't run under Info 6. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
heybooba: I've just picked up on your thread and wonder whether your problem is not due to another issue. Although you state that Info has not been installed on your machine you are trying to access a report in the cinfo/input directory. Any such report will be controlled by the Info APS under which it was created and unless you can log into that APS you should not be able to load the report - this is part of the security model of Info David C. Monks
david.monks@chase-international.com
Accredited Crystal Decisions Enterprise Partner
 
iam using vb5 and crystalreports 4.6
but iam not getting any idea or help
to pass parameter to report
and database is ms access 97
thanks for listening to me

bapujia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top