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

VB and Crystal Report

Status
Not open for further replies.

bidra

Programmer
Joined
Feb 28, 2002
Messages
31
Location
DE
Hi !

Is there any possibility to transfer the value of a VB variable data field to CR so it can be used in formula field there ?I am using VB6 and CR 8.5.

Thanks for any help !

Bidra
 
here is an example of sending two dates from a vb form to crystal reports. it works the same for text boxes etc. you can also send multiple values, like lists from listviews.

hope this helps

Option Explicit
Dim varCRAXDRT_App2 As New CRAXDRT.Application
Dim varCRAXDRT_Rpt2 As New CRAXDRT.Report

Private Sub Form_Load()
'varCRAXDRT_App2 = varCRAXDRT_App
'varCRAXDRT_Rpt2 = varCRAXDRT_Rpt
Dim i
i = 0


Select Case varReportCase
Case "ProgDates"
Set varCRAXDRT_Rpt2 = varCRAXDRT_App2.OpenReport(varReportFileName)
varCRAXDRT_Rpt2.Database.Tables.item(1).SetLogOnInfo "yoda", "", varSYSTEM_USERID, varPASSWORD
varCRAXDRT_Rpt2.ParameterFields(1).AddCurrentValue varStartDate
varCRAXDRT_Rpt2.ParameterFields(2).AddCurrentValue varEndDate
varCRAXDRT_Rpt2.PrinterSetup frmSelectReport.hWnd
frmCrystalViewer.Zoom (85)
frmCrystalViewer.ReportSource = varCRAXDRT_Rpt2
frmCrystalViewer.ViewReport
Set varCRAXDRT_Rpt2 = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top