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

Passing Input from Vb to Crystal Formula, Help pls.

Status
Not open for further replies.

papaboy2

MIS
Jan 28, 2003
52
PH
i have a vb application using crystal report viewer, and i want to pass a parameter to my crystal reports 8.5 built report, but i get a "subscript out of range error" my code looks like this..my formula name is @MyString so when i insert it in the report theres a double "@" sign. thank you very much. help/



Dim lApplication As CRAXDRT.Application
Dim lReport As CRAXDRT.Report

Dim strselection As String


Private Sub Form_Load()

Set lApplication = New CRAXDDRT.Application
Set lReport = lApplication.OpenReport("C:\MYPROJECTS\FUND MANAGEMENT SYSTEM\REPORTS\DIVIDEND PAYMENT.RPT", 1)

lReport.FormulaFields(0) = "@@MyString = 'Sample'"

CRViewer1.ReportSource = lReport
CRViewer1.ViewReport
End Sub

 
Crystal Collection Indexes start at 1 not 0, so your codfe should be

lReport.FormulaFields(1) = "@@MyString = 'Sample'"

However your question states you are trying to passa a value to a paramter and not a formula field, syntax for a parameter would be

iReport.Parameter(1).Value = 'Sample'

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
i tried using this code:

lReport.FormulaFields(1) = "@@MyString = 'Sample'"

but it says "object doesn't support this method or property."

im sorry for the mistake, but im trying to pass a value to a formula named "@MyString"

thank you very much again. i appreciate ur help.
 
I responded to your thread in the VB forum (thread222-852306).

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top