How do I pass parameters to a crystal report?
Printable View
How do I pass parameters to a crystal report?
Are you wanting to pass parameters to select records or for something else?
Yes, I do want to select records.
With CrystalReport1
.Reportfilename = "C:\myreports\report1.rpt"
.Selectionformula = "{Table1.Myfield} = " & SomeNumber
.Action = 1
end with
This will select records where this field is = to somenumber
To select records using a string parameter, you should enclose the parameter with single quotes:
.Selectionformula = "{Table1.Myfield} = '" & Somestring & "'"
Hope this helps
if u r using parameters in cr.
With CrystalReport1
.Reportfilename = "C:\myreports\report1.rpt"
.parameterfield(0) = "paraname;" & SomeNumber &";true"
.Action = 1
end with
Regrads
Amit Pardeshi