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

How to call a Crystal Report from a VB6.0 Application

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a report created in CR 8.0 (COE.RPT). I would like to be able to call this with a command button on a form in my Visual Basic application. Can someone please advise me what the code would look like for this button. The report is going to be located in the same path as the application. Thanks in advance for helping this newbie out.

Austin
 
Go to and type "Visual Basic Examples" to Ask Jeeves. There's a large number of example files on the site. Brian J. Alves
Terrier Consulting, Inc.
Email: brian.alves@worldnet.att.net
VB / Crystal / SQLServer
 
Place the crystal report component on your form and name it as crystalreport1

write the code on click on command button as

CrystalReport1.Connect = ' Path for connecting

Dim strsql As String
strsql = "select * from table1 "

CrystalReport1.SQLQuery = strsql
CrystalReport1.ReportFileName = App.Path "\reports\reportname.rpt"
CrystalReport1.Destination = crptToWindow
CrystalReport1.WindowState = crptMaximized
CrystalReport1.Action = 1
I hope this will solve your purpose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top