Filters with Numerical

Stimulsoft Reports.NET discussion
Post Reply
pca
Posts: 14
Joined: Fri Nov 30, 2007 1:44 pm

Filters with Numerical

Post by pca »

Hello
Filters with Numerical

I expressions with numerical values where int functioning properly:
PatoMovim.MovHaberMa >= (int)PatoMovim.Parameters["@Value"]. ParameterValue

but it does not work with float
PatoMovim.MovHaberMa >= (float)PatoMovim.Parameters ["@ Value"]. ParameterValue

Error:

Method: [DatosPatoMovim__GetFilter]
Specified cast is not valid.

How should I do?


thanks you
Patricio
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Filters with Numerical

Post by Edward »

Please try to modify your expression as follows:

Code: Select all

(floaf)PatoMovim.MovHaberMa >= (float)PatoMovim.Parameters ["@ Value"]. ParameterValue
Thank you.
pca
Posts: 14
Joined: Fri Nov 30, 2007 1:44 pm

Filters with Numerical

Post by pca »

Hello Edward

This did not work
Again

---------------------------
Method: [DatospatoMovim__GetFilter]
Specified cast is not valid.
---------------------------

Thank you.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Filters with Numerical

Post by Edward »

Please change your expression as follows and it'll work:

Code: Select all

(double)PatoMovim.MovHaberMa >= (double)PatoMovim.Parameters ["@ Value"]. ParameterValue
Also please set type of the parameter to double too, if it possible.

This is just a temporary solution.

The issue with converting will be fixed a bit later.

Thank you.
pca
Posts: 14
Joined: Fri Nov 30, 2007 1:44 pm

Filters with Numerical

Post by pca »

Hello Edward
This did not work

(double)PatoMovim.MovHaberMa >= (double)PatoMovim.Parameters ["@ Value"]. ParameterValue

Error :
Method: [DatospatoMovim__GetFilter]
Specified cast is not valid.

The solution is:
System.Convert.ToDouble(PatoMovim.MovHaberMa) >= System.Convert.ToDouble(PatoMovim.Parameters ["@ Value"]. ParameterValue)

Thank you.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Filters with Numerical

Post by Edward »

Thank you very much for this tip. It really works for any type of the parameter! :biggrin:
And it is not necessary to change the type of the parameter from int to double.

Thank you.
Post Reply