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!

VB6 and crystal reports

Status
Not open for further replies.

tyedyejenn

Programmer
Jun 14, 2000
35
US
I was hoping someone could provide me with some help.&nbsp;&nbsp;I am writing a program in Visual Basic 6.&nbsp;&nbsp;I designed a report in Crystal Report 8.&nbsp;&nbsp;Then I found out there is a Crystal Report package that shipped with VB 6.&nbsp;&nbsp;So I installed that.&nbsp;&nbsp;Under Project ¦ Componets I have Crystal Report Control(this added a cystal report icon to my tool box) and Crystal Select Expert OLE Control module(this added a ocx icon to my toolbox) checked.&nbsp;&nbsp;I put a crystal report control on the form the report is to print from.&nbsp;&nbsp;I have the the following code written to print my report:<br><br>CrystalReport1.DataFiles(0) = &quot;C:\vbInfoForJenn\REPORTS&quot;<br><br>CrystalReport1.ReportFileName = &quot;EditList2&quot;<br>&nbsp;<br>CrystalReport1.Destination = crptToPrinter<br>&nbsp;<br>CrystalReport1.PrintReport<br><br>However nothing prints out.&nbsp;&nbsp;I am also confused about which Crystal Report to use.&nbsp;&nbsp;Any help would be greatly appreciated.&nbsp;&nbsp;Thank you in advance for your time.<br><br>Jenn
 
The first problem is that you can't view CR 8 reports with the viewer that comes with VB6 (which is some old version, I forget which).&nbsp;&nbsp;You need to either install Crystal Reports 8 or rewrite the report in whatever version comes with VB6.&nbsp;&nbsp;I don't recommend the second option.&nbsp;&nbsp;CR is a pain in the rear to work with, even in version 8.&nbsp;&nbsp;I cringe at the thought of working with version 6 or earlier.
 
Try this.&nbsp;&nbsp;Instead of saying CrystalReport1.PrintReport use CrystalReport.Action = 1.&nbsp;&nbsp;This worked for CR v5.0.&nbsp;&nbsp;I don't know what version you have.&nbsp;&nbsp;Be sure that you have a defalt printer defined in your report or CR will usually hurl.<br> <p>Steve<br><a href=mailto:tribesaddict@swbell.net>tribesaddict@swbell.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top