answersLogoWhite

0


Best Answer

What version of Crystal reports?

Assumptions:

  • If you have Crystal Reports installed on the development machine, then you will already have all the dll's required for your VB6 project.
  • You're using Crystal Reports v8 or v8.5.
  • You will name the crystal report object 'rpt'.

Configuring the project:

  • In your VB6 project, Select 'Project'->'Components' and check the checkbox for 'Crystal Report Control' and click 'OK'
  • Open the 'Form' view for the form you are coding and drag the 'Crystal' control onto the form.

Coding the project:

  • You can now reference the 'Crystal' object from within your code. Take note of the name of the report object, or change it to something useful.
  • Set the WindowTitle, Connect, ReportFileName and SQLQuery properties to values relevant to your setup.
  • Optionally, you can set the following values: (DiscardSavedData [I recommend setting this to True as it speeds things up in most cases; in fact, I recommend saving your crystal files without any saved data in the first place.], ProgressDialog, and if you have Formulas in the report that you wish to pass in, you can do so using the Formulas(x) property.
  • Once all properties are set, launch the report using the following code:

"rpt.Action = 1"

Sample code:

rpt.WindowTitle = Me.Caption

rpt.Connect = "[Insert ADO Connection String here]"

rpt.ReportFileName = sReportsDirectory + "\SomeReport.rpt"

rpt.DiscardSavedData = True

rpt.ProgressDialog = True

rpt.SQLQuery = "select field1, field2, field3 from tbl1 where field4 = 'Y'"

rpt.Action = 1

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to get Crystal Report control in VB6?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you print reports by vb6 using Crystal Report?

is : CrystalReport1.Reset CrystalReport1.ReportFileName="MyReport.rpt" CrystalReport1.Destination=(Printer) CrystalReport1.Action=6 CrystalReport1.DiscardSaveData=True


You wants to print a single record in crystal report using vb6 but you don't where and how you write query to retreive single from database?

In Crystal Reports, you can write the query directly in the report designer. In the "Database Expert" window, right-click on "Add Command" and write your SQL query to retrieve the single record. After defining the query, you can link it to your report elements to display the data accordingly. Using VB6, you can then call the Crystal Report Viewer to display the report with the single record retrieved from the database.


Difference between Crystal Reports and data report in visual basic?

Data report it reports data .. Crystal report it reports crystal thanks GENIUS


Which reports are easy to create rdlc or crystal report in asp.net?

The reports are easier to create iin crystal report.


What is difference between vb5 vb6?

VB6 is a more recent and more advanced version of visual basic.


What is the name of a book which explains how to create a report with Crystal Reports 10?

There are a few books that are available to explain how to create a report with Crystal Reports 10. One such book would be Creating a Report with Crystal Report 10 - For Dummies. This book can be purchased at a local book store such as Chapters or online at websites like Amazon or eBay.


How do you convert vb6 to dmg?

A .vb6 file is visual basic 6 source code, sometimes with it are .frm files that you would need. A .dmg is a Macintosh binary. you would have to find a program to compile the vb6 code to a Macintosh binary.


How can you execute a new line in VB6?

vbNewLine


How do you install crystal reports for php?

how to create report in php


Differences butween the vb6 asnd vbnet?

Please refer the following link, there you can find useful information about differences between VB6 and VB .NET


How do you make a cp trainer with free member?

use vb6


Free vb6 source code download for submission?

thanks