Discussion Locked

Crystal reports connection with vb6

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

iam using ms access and vb6, crystal report
how to build a crystal report with a parameter.
then how to handle the rpt, with vb and how to send the parameters.
if possible give me an example
regards
saravanakumar.d
98425 62147

1 reply

by miss kitty

In your vb project, you need to add a Crystal reports control and the Crystal viewer control(if you are going to have the user view the report).

On the form which will be calling the Crystal report, here is and example of code.

Option Explicit
Dim crxApplication As New CRAXDRT.Application
Public Report As CRAXDRT.Report
Public FormFrom As String

Private Sub cmdHaulRpt_Click()
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxFormulaField As CRAXDRT.FormulaFieldDefinition
Set Report = crxApplication.OpenReport _
("E:\PLTERA\CRYSTAL REPORTS\HAULER REPORTS\Contract Haulers Report.rpt", 1)
frmViewer.Show vbModal

My example does not show a parameter being passed, but does include the dim statement for it. Here is a link to Crystal Decision's knowledge base article on passing parameters.

http://support.businessobjects.com/communityCS/FilesAndUpdates/scr_vb_ocx_parameter.exe.asp

Cathy

This discussion is closed to new replies.