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

Passing a Parameter to CR using VBasic

Status
Not open for further replies.

cmcgann

Programmer
May 31, 2000
22
0
0
IE
Hi,

I am stuck.
I have created a stored procedure on SQL Server which accepts one parameter.
I have then setup a Crystal report which reports from this Stored Procedure.

In Visual basic, i want to Call this Crystal report and pass it the parameter it needs to return data.

The following is the code i use.
On Error GoTo errhandler


CrystalReport1.ReportFileName = "d:\shipping.rpt"
CrystalReport1.StoredProcParam(0) = retstring ' This holds the parameter.
CrystalReport1.PrintReport

errhandler:
Exit Sub

End Sub

Unfortunately the report returns nothing.

Any help at all would be much appreciated

Conor
 
Can you get the report to work if you launch a report using an SP without a parameter? That lets you know if it is the parameter that is the problem or something more basic. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Ken,

I did tried it without passing the parameter and it works fine. I reckon its the way i am passing it is incorrect,


Thanks

 
It may be in the way you are puncutating the string. Sometimes it is hard to calculate how the value's quotes will pass from VB to CR to the SP.

Is the data type a string? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top