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

How to run a Crystal Report with parameters

Status
Not open for further replies.

ije

MIS
Jun 10, 2002
38
AU
Hello,

Does anyone has some example code they would like to share showing how to run a Crystal report off the users PC, passing to it a few parameters contained in the script?

Even nicer, would be an example showing how to save the results to file automatically.

Thanks in advance,

ije
(ps- i am a newbie to VBS - please be gentle if this is a straightforward task!)
 
SET oCRApp = Createobject("crystal.crpe.application")
SET oReport = oCRApp.OpenReport("C:\MyPath\MyReport.rpt")
oReport.ParameterFields(0) = 2 'set 1st parm value to 2
oReport.ExportOptions.FormatType = 14 'to Word doc
oReport.ExportOptions.DiskFileName = "C:\MyPath\MyDoc.doc"
oReport.ExportOptions.DestinationType = 1
oRep.Export False 'True to see dialog
SET oReport = Nothing
SET oCRApp = Nothing

This is off the top of my head so it may not be 100% syntactically correct, but it should get you in the ballpark. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top