Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys,

how to get the value from textbox or any other control and use it in crystal reports in vb6 by clicking a button? this report will be displayed in crystal report viewer.

please answer asap, thanks and God Bless! :)
Posted
Updated 24-May-18 17:13pm

Use Parameter fields in crystal report.

Passing Multiple Parameters to a Crystal Report Programmatically[^]

VB.NET Crystal Reports String parameter[^](But syntax is mostly same as VB 6)
 
Share this answer
 
you can try this
Dim CRApp As Object
Dim Report As Object
Dim strsql As String
Dim rs As ADODB.Recordset, rs2 As ADODB.Recordset
Set rs = New ADODB.Recordset

strsql = "SELECT TR.*"
strsql = strsql & vbCrLf & "FROM ViewSchedulingShift TR"
rs.Open strsql, strCONN, adOpenDynamic, adLockOptimistic

Set Report = CRApp.OpenReport(App.Path & "\Crystal Reports\rSchedulingShift.rpt")
Report.Database.SetDataSource rs
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
CRViewer1.Zoom (100)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900