p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

crystal_reports thread: Parameters


Message #1 by carl@c... on Fri, 21 Jun 2002 14:37:19
Hi,

I am passing 2 parameters, startdate and enddate from ASP to Crystal.

Param1.EnableMultipleValues = 1
ParamValue = startdate
Call Param1.AddCurrentValue (cdate(ParamValue))
	
set Param2 = session("ParamCollection").Item(2)
ParamValue1 = enddate
Call Param2.SetCurrentValue(cdate(ParamValue1))

I have set up 2 parameters in crystal to recieve this data.  I have set 
them up as datetime.

If drag and drop my parameters onto the report and run it through my asp 
application the dates show correctly on the report.  If I then put the 
dates into a simple function and put the function on to the report I get 
an error message saying "The result of a formula cannot be an array"

All I did was create a function called date and just include the startdate 
parameter and this error happened.  It seems that crystal seems to think 
that when I include a parameter into a function it thinks that paramter is 
an array!!

Can any one help?
Message #2 by Tony Cooper <Tony.Cooper@H...> on Fri, 21 Jun 2002 14:45:22 +0100
Hi Carl

I've always found it best to pass the date formatted as a string dd/yy/yyyy
and have crystal convert it back to a dateformat.

HTH
Tony

-----Original Message-----
From: carl@c... [mailto:carl@c...]
Sent: 21 June 2002 15:37
To: crystal_reports
Subject: [crystal_reports] Parameters


Hi,

I am passing 2 parameters, startdate and enddate from ASP to Crystal.

Param1.EnableMultipleValues = 1
ParamValue = startdate
Call Param1.AddCurrentValue (cdate(ParamValue))
	
set Param2 = session("ParamCollection").Item(2)
ParamValue1 = enddate
Call Param2.SetCurrentValue(cdate(ParamValue1))

I have set up 2 parameters in crystal to recieve this data.  I have set 
them up as datetime.

If drag and drop my parameters onto the report and run it through my asp 
application the dates show correctly on the report.  If I then put the 
dates into a simple function and put the function on to the report I get 
an error message saying "The result of a formula cannot be an array"

All I did was create a function called date and just include the startdate 
parameter and this error happened.  It seems that crystal seems to think 
that when I include a parameter into a function it thinks that paramter is 
an array!!

Can any one help?
Message #3 by "Carl Massey" <Carl@c...> on Mon, 24 Jun 2002 09:14:35 +0100
Thanks for the reply but how does this resolve the "This array must be
subscripted. For example: Array [i]" error and other array errors even
when i'm not using arrays?

-----Original Message-----
From: Tony Cooper [mailto:Tony.Cooper@H...]
Sent: 21 June 2002 14:45
To: crystal_reports
Subject: [crystal_reports] RE: Parameters


Hi Carl

I've always found it best to pass the date formatted as a string
dd/yy/yyyy
and have crystal convert it back to a dateformat.

HTH
Tony

-----Original Message-----
From: carl@c... [mailto:carl@c...]
Sent: 21 June 2002 15:37
To: crystal_reports
Subject: [crystal_reports] Parameters


Hi,

I am passing 2 parameters, startdate and enddate from ASP to Crystal.

Param1.EnableMultipleValues =3D 1
ParamValue =3D startdate
Call Param1.AddCurrentValue (cdate(ParamValue))
=09
set Param2 =3D session("ParamCollection").Item(2)
ParamValue1 =3D enddate
Call Param2.SetCurrentValue(cdate(ParamValue1))

I have set up 2 parameters in crystal to recieve this data.  I have set
them up as datetime.

If drag and drop my parameters onto the report and run it through my asp

application the dates show correctly on the report.  If I then put the
dates into a simple function and put the function on to the report I get

an error message saying "The result of a formula cannot be an array"

All I did was create a function called date and just include the
startdate
parameter and this error happened.  It seems that crystal seems to think

that when I include a parameter into a function it thinks that paramter
is
an array!!

Can any one help?

Message #4 by Tony Cooper <Tony.Cooper@H...> on Mon, 24 Jun 2002 10:14:11 +0100
Carl

It's not because you have set the following
 Param1.EnableMultipleValues = 1

Try commenting that line out.
I must admit that I haven't used that before and I don't seem to have had
any errors? Ooops I shouldn't have said that....:-)

Tony

-----Original Message-----
From: Carl Massey [mailto:Carl@c...]
Sent: 24 June 2002 09:15
To: crystal_reports
Subject: [crystal_reports] RE: Parameters


Thanks for the reply but how does this resolve the "This array must be
subscripted. For example: Array [i]" error and other array errors even
when i'm not using arrays?

-----Original Message-----
From: Tony Cooper [mailto:Tony.Cooper@H...]
Sent: 21 June 2002 14:45
To: crystal_reports
Subject: [crystal_reports] RE: Parameters


Hi Carl

I've always found it best to pass the date formatted as a string
dd/yy/yyyy
and have crystal convert it back to a dateformat.

HTH
Tony

-----Original Message-----
From: carl@c... [mailto:carl@c...]
Sent: 21 June 2002 15:37
To: crystal_reports
Subject: [crystal_reports] Parameters


Hi,

I am passing 2 parameters, startdate and enddate from ASP to Crystal.

Param1.EnableMultipleValues = 1
ParamValue = startdate
Call Param1.AddCurrentValue (cdate(ParamValue))
	
set Param2 = session("ParamCollection").Item(2)
ParamValue1 = enddate
Call Param2.SetCurrentValue(cdate(ParamValue1))

I have set up 2 parameters in crystal to recieve this data.  I have set 
them up as datetime.

If drag and drop my parameters onto the report and run it through my asp

application the dates show correctly on the report.  If I then put the 
dates into a simple function and put the function on to the report I get

an error message saying "The result of a formula cannot be an array"

All I did was create a function called date and just include the
startdate 
parameter and this error happened.  It seems that crystal seems to think

that when I include a parameter into a function it thinks that paramter
is 
an array!!

Can any one help?



  Return to Index