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

Crystal Report and VB 1

Status
Not open for further replies.

vsundar2

Programmer
Dec 15, 2000
9
US
Hi,

I am new to Crystal Report and VB. I am using Crystal Reports 8.5 and VB 6. I need help or sample code on how to pass a parameter value to Crystal Reports from VB.

Thanks
-V
 
Hi,

I found the solution to my problem.

Dim crxapp As New CRAXDRT.Application
Dim crxrpt As CRAXDRT.Report
Dim crxParameters As CRAXDRT.ParameterFieldDefinitions
Dim crxParameter As CRAXDRT.ParameterFieldDefinition
Dim Docket_no As String

Private Sub RunReport_Click()
Set crxrpt = crxapp.OpenReport("d:\projects\myvb\2ndpage.rpt")
CRViewer1.ReportSource = crxrpt
Set crxParameterFields = crxrpt.ParameterFields
Set crxParameterField = crxParameterFields.Item(1)
Docket_no = "123456"
crxParameterField.SetCurrentValue Docket_no
CRViewer1.ViewReport
End Sub

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top