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!

Error setting Crystal Reports COM Object Property

Status
Not open for further replies.

TheDrider

Programmer
Jun 27, 2001
110
US
I'm trying to access the Crystal Reports COM Object and cannot set the 'ParameterFields' property. This property is actually an array in the COM object. The syntax in VB is simple:
CrystalReport.ParameterFields(0) = "StartHour;12;TRUE"

This won't work in CF: I cannot use a &quot;function on the left side of an assignment&quot;. I also tried using CF array syntax [], and setting the property = to a CF array ( <CFSET CR.ParameterFields = myArray> )

I don't think this is specifically a Crystal problem but rather one with property arrays in general.

Here's my code. The error line is commented out.
Code:
<CFOBJECT TYPE=&quot;COM&quot; ACTION=&quot;Create&quot;
 CLASS=&quot;Crystal.CrystalReport&quot;
 NAME=&quot;CrystalReport&quot;>

<CFSET CrystalReport.ReportFileName = &quot;filename.rpt&quot;>
<CFSET CrystalReport.Connect = &quot;DSN=DSN_NAME&quot;>
<CFSET CrystalReport.Destination = 0>

<!---
I can't get the parameters working correctly from CF.
<CFSET CrystalReport.ParameterFields(0) = &quot;StartHour;12;TRUE&quot;>
--->
	
<!--- Display the report --->
<CFSET CrystalReport.Action = 1>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top