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

Passing Stored Proc Parameters from VB

Status
Not open for further replies.

DiggerDog

Programmer
Nov 24, 2002
60
AU
HI

I am using the Crystal report Crystl32.ocx and am trying to pass parameters to my report using the StoredProcParam(N) method
The problem is my report ignores the parameters I pass to it and instead displays the saved data in the report. Unchecking the 'save data with report' option in the report designer does not help.
Here is my code

With CrystalReport1

.ReportFileName = "C:\Work\Crystal\Design\Performance Summary.rpt"
.Connect = "DSN = ODBC Connection;UID = username;PWD = password;DSQ = database"

.DiscardSavedData = True



.StoredProcParam(0) = "M"
.StoredProcParam(1) = "%"
.StoredProcParam(2) = "%"
.StoredProcParam(3) = "%"
.StoredProcParam(4) = "%"
.StoredProcParam(5) = "%"
.StoredProcParam(6) = "%"

.Destination = crptToFile
.PrintFileType = crptCrystal
.PrintFileName = "C:\Work\Crystal\VB\test2.rpt"

.PrintReport
End With

thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top