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!

COM Crystal Report Viewer and Parameters

Status
Not open for further replies.

HouDog

Programmer
Aug 14, 2003
54
CA
Hi all, according to the documentation, CE 9.0 has deprecated using promptex as a means of passing parameters to a report. They suggest using the COM Crystal Report viewer.

My question is...How in the world do you pass parameters to a report at run time and not have the parameter page pop up. I have looked high and low and found NOTHING.

Any help would be greatly appreciated.

 
Set objFactory = CreateObject("CrystalReports.ObjectFactory.2")

Set rptAppSession = objFactory.CreateObject("CrystalEnterprise.ReportAppSession")

Set clientDoc = rptAppSession.CreateService("CrystalClientDoc.ReportClientDocument")

set Param = objFactory.CreateObject("CrystalReports.ParameterField")

set gbparm = objFactory.CreateObject("CrystalReports.ParameterFieldDiscreteValue")

rptAppSession.Initialize

clientDoc.Open Path & "\" & theReportName

gbparm = "TESTparameter"
clientDoc.DataDefinition.ParameterFields(0).copyto Param
Param.CurrentValues.Add gbparm

clientDoc.DataDefController.ParameterFieldController.modify 0,Param

There is also an example at the Com - Viewer SDK - Help
 
Thanks, I'll try it...but I'm not using the RAS so I'm not sure this will work. Also, your example is modifying the actual report...is it not ? Would i then pass the report client doc as the report source for the viewer ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top