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

Pass parameter to Crystal

Status
Not open for further replies.

tmar

MIS
Mar 24, 2007
62
US
I would like pass a parameter to a crystal report through code and every article I've found on the topic has been too confusing for my simple mind.

Let's say I've got a report located on a shared drive (P:\report.rpt) for example.

The report has 1 parameter, "work order" to which I want to assign the value that is in field me.txtworkorder.text.

I've got a report viewer called rptviewer embedded on form frmReportViewer.

Can anyone help me with the rest.
 
Hi tmar,

Based on your report being part of your project the way i did was:
Code:
Dim _report As New report
_report.SetParameterValue("nameofvariable",me.txtworkorder.text) 
_report.PrintToPrinter(1, True, 1, 1000)
Thats how to setup up the report and send straight to the printer but you will just want to pass your report to the viewer.

Hope this helps.

Alex

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Rick Cook, The Wizardry Compiled
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top